[thelist] Tip - ColdFusion and Datasources

rudy rudy937 at rogers.com
Fri Aug 15 20:03:19 CDT 2003


> ooooh, now with subqueries....

slag mysql all you want

hell, if anybody can, i can

but listen up -- they do some things really well, e.g. they support some
stuff that other databases don't

for example, if you have a form with multiple entries on it, like an order
form with ten order items, and you want to insert the multiple entries into
a table, you can do this --

  insert into orderitem
    (orderno,orderitemno,qty,price)
  values (27,342,5,5.98)
     , (27,613,1,7.98)
     , (27,42,2,12.00)
     , (27,887,1,14.99)
     , (27,211,1,5.95)
     , (27,61,1,12.50)
     , (27,57,1,7.98)
     , (27,712,1,5.00)
     , (27,74,1,2.00)
     , (27,5012,1,14.99)

in other words, you call the database once, instead of ten times in a loop

(you would loop, of course, but only to build the query string)

weird syntax you say?  yeah, but it's lovely, innit?

i don't have any sql3 resources (look ma, no books -- and of course this
stuff is not to be found online) but a guy i know, a guy who knows sql even
better than i, assured me that this is actually in sql3, i.e. the sql
standard

on the other hand, the mysql developers should be shot for allowing crap
like feb 30 into a datetime field


rudy



More information about the thelist mailing list