HighDots Forums  

Insert Query for Database

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Insert Query for Database in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thundaga
 
Posts: n/a

Default Insert Query for Database - 08-20-2004 , 04:02 PM






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


Reply With Quote
  #2  
Old   
Alexandru COSTIN
 
Posts: n/a

Default Re: Insert Query for Database - 08-20-2004 , 04:52 PM






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




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.