Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to use CURRVAL with a sequence generator?
On Wed, 24 Nov 2004, weberm_at_polaris.net wrote:
> I am attempting to write some PL/SQL which will look at a
> sequence generator which is used to create receipt numbers and
> determine if assigning n receipts will exceed its last value
> (the sequence was created with the NONCYCLE option).
>
> However, my attempts to use CURRVAL return some sort of
> "unidentified value this session" ORACLE exception if I do not
> use NEXTVAL, yet I am able to see the last value used in TOAD.
>
> Is there a way to replicate what I am seeing in TOAD?
It doesn't matter whether it is TOAD, sqlplus, PL/SQL or Larry Ellison for that matter. A nextval must be issued for a currval to have any meaning. In TOAD's SQL session, somewhere, somehow, maybe hidden to you for some odd reason, a nextval was issued.
-- Galen BoyerReceived on Wed Nov 24 2004 - 10:29:16 CST
![]() |
![]() |