wrap the first insert query in a cftransaction tag, with a select query
within the cftransaction to select maxID, then use the returned value in
your second insertion query.

Jb.

-----Original Message-----
From: Shahzad.Butt [mailto:[EMAIL PROTECTED]
Sent: 28 November 2003 13:25
To: CF-Talk
Subject: Getting last inserted idenity value

   


Hi


I am using CFMX and Access2000. In my action page I've got two insertion
queries one inserts in table1 and other one inserts in table2. Both of
these tables has got primary key as autoincrement number. Second query
needs to add the primary key generated from first query as a foreign
key. How would I get the PK of the record just inserted. I know in
SQLServer we could use @@IDENTITY but unfortunately I am using access at
the moment

Thanks


Shahzad.Butt
Ph:  +44 (0) 1992 701 722
Fax: +44 (0) 1992 701 604


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to