Click here to Skip to main content
16,004,406 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can some one verify my thinking here? Does this code return the correct Sequence Number as Inserted by my statement:

SQL
INSERT (myTablePrimaryKey, Field1, Field2)
VALUES (myTableSeqNo.NextVal, 'Data1', 'Data2')

Select myTableSeqNo.currval


Does this return the sequence number I inserted to the table and is it guaranteed to be mine in a busy environment with many users and inserts?

Thanks.
Posted
Updated 18-May-11 17:58pm
v3

1 solution

Yes it does, as oracle records the currval by session. Unless someone is using your session at the same time. It will be the same.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900