[thelist] Tip - ColdFusion and Datasources
Paul Cowan
evolt at funkwit.com
Sun Aug 17 06:45:39 CDT 2003
rudy wrote:
> 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 --
<carygrant>Rudy, Rudy, Rudy...</carygrant>
You can do a multiple-insert in a single statement in most SQL databases...
you just have to think laterally.
<tip type="SQL" author="Paul Cowan">
Need to do multiple inserts in a single SQL statement? Try this.
Should work in most any SQL-89 compliant database, if I'm not
mistaken...
insert into orderitem
(orderno,orderitemno,qty,price)
select
27,342,5,5.98
union all select
27,613,1,7.98
union all select
27,42,2,12.00
... etc ..
Easy peasy!
</tip>
More information about the thelist
mailing list