Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sequence question
Phil Kaufman wrote:
> Thanks very much for your reply Sybrand. > > It seems that one can't use the system table to determine the current value > of a sequence that is defined with a cache (as ours is, and is the database > engine default), since the 'last_number' column of the system view (in both > user and dba views) references the latest cached value, not the current last > used value. > > Anyhow, thanks anyway for your suggestion. > > > "Sybrand Bakker" <gooiditweg_at_nospam.demon.nl> wrote in message > news:i6nk5v4e7r4afhg0bk2pdch0dvij9vl6fb_at_4ax.com... >
> message >
> of >>>>I've determined that I must first get the next sequence value from the
>>>a sequence by executing the following statement:
>>>
>>>select seq_some_sequence.currval from dual
>>> *
>>>ERROR at line 1:
>>>ORA-08002: sequence SEQ_SOME_SEQUENCE.CURRVAL is not yet defined in this
>>>session
>>>
> question >>>>Also, I don't remember this being an issue with pre 8 databases, though I
>>>is; is there a way to determine the current value of a sequence without
>>>doing a NEXTVAL first?
>>>
> since >>>>Thanks in advance.
>>>version 7.3.4.
>>>
>>>Anyway, any response is welcomed.
>>>
Perhaps if you posted the business problem you are trying to solve, someone on this board could offer a suggestion.
-- AJ AllenReceived on Mon Feb 24 2003 - 16:42:17 CST