Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: User_Sequence's LAST_NUMBER column: what is it?
Jerry Liu wrote:
>
> Would someone know what the "LAST_NUMBER" column of the user_sequences
> dictionary table contains? It does not seem to be related to the
> "NEXTVAL" or "CURRVAL" (see below)
> -----------------------------------------------------------------------------
> SQL> ed
> Wrote file afiedt.buf
>
> 1 select SEQUENCE_NAME, min_value, max_value, last_number
> 2* from user_sequences where sequence_name = 'MY_SEQ_20011010'
> SQL> /
>
> SEQUENCE_NAME MIN_VALUE MAX_VALUE LAST_NUMBER
> ------------------------------ ---------- ---------- -----------
> MY_SEQ_20011010 1 1.0000E+27 21
>
> SQL> select MY_SEQ_20011010.nextval, MY_SEQ_20011010.currval from
> dual;
>
> NEXTVAL CURRVAL
> ---------- ----------
> 8 8
> -------------------------------------------------------------------------------
> Thanks,
>
> Jerry
Hello Jerry,
you created your sequence with CACHE option (default option, if you
don't like it you have to specify NOCACHE during creation of the
sequence). CACHE means Oracle preallocates the numbers and keeps them in
memory for faster access. In this case, column LAST_NUMBER dispays the
last cached number. Default cache: 20 sequence numbers. For more
information, please look at
Create yourself a free account on otn if you don't already have one.
Regards
Manuela Mueller
Received on Thu Oct 11 2001 - 15:28:46 CDT
![]() |
![]() |