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: how to know the latest sequence number?

Re: how to know the latest sequence number?

From: Bill Han <billxhan_at_hotmail.com>
Date: Thu, 17 Jan 2002 10:13:40 GMT
Message-ID: <otx18.7994$0c.329172@news3.calgary.shaw.ca>


Hi Fred,

Is this way safe if many users are running that procedure at the same time? I mean just between INSERT and get CURRVAL events, what happens if there is another user runs this procedure to increase the sequence value?

Thanks for your help,
Bill

"fred" <ommerbornf_at_free.fr> wrote in message news:3c46a0a8$0$211$626a54ce_at_news.free.fr...
> Look at the currval
>
> Just after invoking a nextval you may look at the current value of the
> sequence whith currval.
>
> Sorry for my poor english.
> Best regards.
> Fred
>
> "Bill Han" <billxhan_at_hotmail.com> a écrit dans le message news:
> t5x18.7616$467.301188_at_news2.calgary.shaw.ca...
> > Hi everyone,
> >
> > I use a sequence's next value as table's primary key to append a record.
> > After that, how can I know what that number is?
> >
> > insert into Contact (contact_id, contact_name)
> > values (contact_seq.nextval, in_contact_name)
> >
> > then I want to know what is the contact_id I just used?
> >
> > Thanks,
> > Bill
> >
> >
>
>
Received on Thu Jan 17 2002 - 04:13:40 CST

Original text of this message

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