Yes, but then we are back to the original question of how to get that
last ID from the DB so the code can use it.

To be completely safe, there are two alternatives:

1) Use a trigger on the table to perform an "autoincrement" operation
with the sequence. Wrap the INSERT and the subsequent SELECT
MAX(someID) in a cftransaction, with an isolation level of
serializable. This last bit is important.

2) Get the value from the sequence first and then do the insert,
remembering the value that was obtained from the sequence. This can be
done in a stored procedure or in CF code.

On 10/6/06, Aaron Rouse <[EMAIL PROTECTED]> wrote:
> For people who are used to SQL server, the best thing to do would be to
> setup a trigger and that trigger in Oracle could grab the next sequence
> value and insert it when new data is being inserted into the table.

-- 
CFAJAX docs and other useful articles:
http://www.bifrost.com.au/blog/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255748
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to