Short answer - almost always. Unfortunately, thats only almost good enough.
If you do sql like
select pkey_col
from table
where xxxxx
And fill in xxxx with the data that you just inserted, it will work
99.999999% of the time. But not 100%. Depending on your data, it might
work 100% of the time.
For that reason, we never define our pkeys to be autopopulating. We use a
sequence and two SQL statements; one to get the next value from the sequence
(from dual) and the next to insert using the value we just got. Afterwards,
we have the value of the sequence that we used.
Brian
-----Original Message-----
From: Jones, Becky [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 05, 2001 10:02 AM
To: CF-Talk
Subject: update
is there anyway to output the last primary key number in a table after an
insert statement?
i need to capture that number on the same action page so i can pass it to
another table.
in other words, on my insertApp.cfm i have the query to update my apps
table.
but on this same page at the bottom, i have another form...a form to update
the licensing. when i submit this form, i need that primary key from my
apps table to pass thru to my licensing table.
so i need a way to capture that value.
any ideas?
*************************************************
This e-mail, including any attachments, is intended for the
receipt and use by the intended addressee(s), and may contain
confidential and privileged information. If you are not an intended
recipient of this e-mail, you are hereby notified that any unauthorized
use or distribution of this e-mail is strictly prohibited.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists