Some RDBMSs allow multiple records to be inserted into a table at once, but
I don't know of any that allow you to insert records into multiple tables at
once.  If you're using stored procedures, then you can pass all the
parameters to the procedure with a single invocation, which in turn does
multiple inserts.  That would shield the application from knowing about
multiple database interactions.

Here's MySQL's syntax for multiple inserts:

INSERT INTO myTable
  (id, name, dob)
VALUES
  (1, 'barney', '1980-06-10 '0:08:00'),
  (1, 'peggy', '1982-04-16 '9:56:00');



---
Barney Boisvert, Senior Development Engineer
AudienceCentral
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax   : 360.647.5351

www.audiencecentral.com


> -----Original Message-----
> From: mayo [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 08, 2003 4:56 PM
> To: CF-Talk
> Subject: insert multiple records into multiple tables
>
>
> I've gotten myself completely lost.
>
> I have a form in which I would like to insert multiple records
> into multiple
> tables. The trouble comes in grabbing the record IDs from one table and
> inserting them in the other.
>
> Currently I insert one record at a time. What I would like to do is to be
> able to insert multiple items at one time and am going nowhere fast.
>
>
> INSERT into table1
>       (
>       'A',
>       'B',
>       'C'
>       )
> VALUES
>       (
>       '#FORM.A#',
>       '#FORM.B#',
>       '#FORM.C#'
>       )
>
>
> INSERT into table2
>       (
>       'D',
>       'E',
>       'F'
>       )
> VALUES
>       (
>       '#FORM.D#',
>       '#FORM.E#',
>       '#FORM.F#'
>       )
> WHERE ????????
>
>
> I'm totally lost.
>
>
> TIA
>
> Gilbert Midonnet
>
>
>
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to