I have a database with 2 tables one has a relationship with the other and
when I do an insert I need to insert into table 1 and insert into table 2
with an var_id field that has not been generated until table 1 has been
inserted into.. I am not sure what to do or how to do it.. I am using CF 5
Use CFTRANSACTION so if the action fails you can rollback.
HTH
Donnie Bachan
Phone: (718) 217-2883
ICQ#: 28006783
Nitendo Vinces - By Striving You Shall Conquer
==
The information transmitted is intended only for the person or
: Donnie Bachan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 10:53 AM
To: CF-Talk
Subject: Re: Inserting into 2 tables with a relationship
Use CFTRANSACTION so if the action fails you can rollback.
HTH
Donnie Bachan
Phone: (718) 217-2883
ICQ#: 28006783
Nitendo Vinces - By Striving You
Okay let's say that you are incrementing the primary key in the first table
upon an insert, and then you want to insert the value of that key into the
second table as var_id, what you have to do is after you did the first
insert, you need to
select max(variable) as new_var_id from table1
, 2002 1:59 PM
To: CF-Talk
Subject: RE: Inserting into 2 tables with a relationship
Okay let's say that you are incrementing the primary key in the first
table
upon an insert, and then you want to insert the value of that key into
the
second table as var_id, what you have to do is after you did
I suggest using the custom tag... Max_ID from the Macromedia Custom Tag library. It is
well documented. Then search the archives for discussions on use of the tag.
I use this exclusively now and avoid AutoIncrementing primary key fields like the
plague.
hth
Brian
At 10:49 AM 5/16/02 -0500,
12:16 PM
To: CF-Talk
Subject: Re: Inserting into 2 tables with a relationship
I suggest using the custom tag... Max_ID from the Macromedia Custom Tag
library. It is well documented. Then search the archives for discussions on
use of the tag.
I use this exclusively now and avoid AutoIncrementing
: Thursday, May 16, 2002 3:16 PM
To: CF-Talk
Subject: Re: Inserting into 2 tables with a relationship
I suggest using the custom tag... Max_ID from the Macromedia Custom Tag
library. It is well documented. Then search the archives for discussions on
use of the tag.
I use this exclusively now
8 matches
Mail list logo