-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, May 14, 2001 at 10:52:28AM -0600, Sterin, Ilya wrote:
> In Oracle you must run the "select increment_name.nextval from dual" query
> and then fetch from it to retrieve the row, you can then use that value for
> all of your inserts.  I wouldn't recommend using *curval* since if you want
> to make sure inserts are in order, some simultaneous transactions might
> process before you retrive curval and therefore the insert will fail.

Arg...quit spreading that falsehood.  <sequence>.currval is serialized between
transactions.  You will always get the last value returned to your current
transaction, even if the sequence has moved on at the global level.  There is
no race condition like you describe.

In short, use currval -- it is your (much simpler) friend.

- -- 
Stephen Clouse <[EMAIL PROTECTED]>
Senior Programmer, IQ Coordinator Project Lead
The IQ Group, Inc. <http://www.theiqgroup.com/>

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBOwAiPQOGqGs0PadnEQJ0qQCglihJ6Het7RbGoIRYLaxBacRKON8An0v3
GkBYM5aJN5Y9lhufL5SRrxst
=6RQ9
-----END PGP SIGNATURE-----

Reply via email to