Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Auto-incrementing primary key?

Re: Auto-incrementing primary key?

From: Phil Herring <revdoc_at_uow.edu.au>
Date: 1998/01/15
Message-ID: <69m1sn$pui$1@wyrm.its.uow.edu.au>#1/1

In article <34BE598E.7468_at_lilly.com> Ed Bradt, ebradt_at_lilly.com writes:
>Sure the user can get CURRVAL but there's no guarantee that someone else
>hasn't made another hit on the sequence in between.

This is not the case.

Within any given session, you can refer to CURRVAL at any time after referring to NEXTVAL. Until that session ends, CURRVAL will *always* contain the last value obtained from NEXTVAL. The only way that it will change is if you refer to NEXTVAL again within the same session, or if the session ends.

This occurs indpenedently of commits, rollbacks, and the activity of other system users.



Copyright 1998 Phil Herring. This article may not be reproduced for profit.
Received on Thu Jan 15 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US