Hello,
You basically have two approaches.
1. you generate the insert SQL command for the primary table, then
you manually change the code, retrieve the newly inserted ID, then
create the second SQL and execute it
2. The second (smarter, but it involves a commercial product

way
would be to get our ImpAKT product -
http://www.interaktonline.com/products/ImpAKT/
It allows you to define some triggers that are executed along with
an SQL insert, and you can easily retrieve the newly inserted record id
and use it in a custom trigger to create a new SQL query. We plan to add
direct support for inserting into two tables in the next version - April
2005.
You might also find this interesting -
http://www.dmxzone.com/ShowDetail.asp?NewsId=5320
Sincerely,
Alexandru
Thundaga wrote:
Quote:
I'm trying to get comfortable with Dreamweaver's command behavior for executing
an SQL insert, but I'm having a problem with figuring out how to do this.
I have two tables that have to be updated when a user inputs a form to the
form confirmation page. One table is for the customer's contact information,
the other is for the inquiry itself. I have a ContactID as a foreign key in
the Inquiry table because one customer could have many inquiries. How do I go
about inserting the ContactID that was just generated when the Contact table
was updated, into the Inquiry table? Both Primary keys are autonumbers.
Thanks,
Chad |