Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: CURRVAL in multi-user environments
Thomas Gaines wrote:
> Matt -
>
> This sounds simple enough to test. Give it a try and answer
> your own question...
>
> TG
>
> Matthew Nicoll wrote:
>
> > The Oracle documentation I have seen suggests I can define a sequence,
> > then use sequence_name.NEXTVAL for an ID for a parent row,
> > then use sequence_name.CURVAL in subsequent writes to child rows.
> >
> > In a multi-user environment, if the order of events is:
> > User 1 - NextVal gets 100
> > User 2 - NextVal gets 101
> > User 1 - CurrVal gets 100 or 101?
> >
> > I.e. is Oracle smart enough to keep a different CURRVAL for
> > each user?
Good advise. But consider this ... what happens to a variable in a procedure or package if more than one user is executing it at the same time? What happens to the results of a SELECT statement if two users are executing it at the same time?
I think the answer to your question is obvious if you give it some thought.
Daniel Morgan Received on Wed May 22 2002 - 10:03:32 CDT
![]() |
![]() |