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

Home -> Community -> Usenet -> c.d.o.misc -> Re: CURRVAL in multi-user environments

Re: CURRVAL in multi-user environments

From: Thomas Gaines <Thomas.Gaines_at_noaa.gov>
Date: Mon, 03 Jun 2002 11:32:05 -0600
Message-ID: <3CFBA815.6946F9B6@noaa.gov>


Matt -

I intended no smugness in my original response to your question. I've dealt with a number of rather easy-to-answer inquiries in various forums, and instead of just telling the person the easy answer, I like to point that person to the documentation or just encourage him or her to run a little code and find out for himself. The ability to research an answer is too often neglected these days, IMHO.

Remember that newsgroups like this (as well as other forms of assistance like Wrox Publishing P2P) are meant as a public service, and no one here is obligated to do your work for you. We enjoy helping others, but we'd rather see you giving your question as much effort as you reasonably can before calling on others. I'm not a big fan of old sayings and proverbs, but an old Chinese proverb says "Give a man a fish, and he'll eat for a day. Teach him how to fish and he'll eat forever." I have to agree. Daniel Morgan probably does, too.

Why, it's enough to turn one onto the Republican party! ;-)

TG

Matthew Nicoll wrote:

> Thanks for the smug help, gentlemen.
>
> On Wed, 22 May 2002 15:03:32 GMT, Daniel Morgan
> <dmorgan_at_exesolutions.com> wrote:
>
> >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 Mon Jun 03 2002 - 12:32:05 CDT

Original text of this message

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