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: nextval from dual;

Re: nextval from dual;

From: Richard Kuhler <noone_at_nowhere.com>
Date: Wed, 27 Nov 2002 05:20:18 GMT
Message-ID: <mCYE9.39418$2z1.15334262@twister.socal.rr.com>


By jove I know you're wrong!

CURRVAL only returns the last value retrieved from a NEXTVAL within your specific session. You can't use it at all if you haven't made a call to NEXTVAL. Regardless, it wouldn't give you the NEXT value like the poster asked for. I know of no easy way to get the next value without actually incrementing it. Perhaps there is some undocumented method to access the internal Oracle constructs but I'm not familiar with what it would be. More significantly, I can't imagine what use it would be to know what the next value is going to be.

Just what are you going to do with this?

No offense,
Richard

scotty wrote:
>
> Bag o' Fog wrote:
>
> >Could anyone tell me how to get the next value of an auto-number field
> >in oracle without bumping the auto-number up one, like this seems to
> >
> >select autonum_sequence_corporate_id.nextval from dual;
>
> By jove I think i've got it!
>
> select autonum_sequence_corporate_id.currval from dual;
Received on Tue Nov 26 2002 - 23:20:18 CST

Original text of this message

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