Inserting into 2 tables with a relationship

2002-05-16 Thread LANCASTER, STEVEN M. (JSC-OL) (BAR)
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

Re: Inserting into 2 tables with a relationship

2002-05-16 Thread Donnie Bachan
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

RE: Inserting into 2 tables with a relationship

2002-05-16 Thread LANCASTER, STEVEN M. (JSC-OL) (BAR)
: 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

RE: Inserting into 2 tables with a relationship

2002-05-16 Thread Donnie Bachan
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

RE: Inserting into 2 tables with a relationship

2002-05-16 Thread Kevin Schmidt
, 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

Re: Inserting into 2 tables with a relationship

2002-05-16 Thread Brian Scandale
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,

RE: Inserting into 2 tables with a relationship

2002-05-16 Thread Costas Piliotis
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

RE: Inserting into 2 tables with a relationship

2002-05-16 Thread Joe Bastian
: 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