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: Getting currval from a sequence with out incrementing nextval

Re: Getting currval from a sequence with out incrementing nextval

From: Brian Peasland <oracle_dba_at_nospam.peasland.net>
Date: Mon, 1 May 2006 17:54:32 GMT
Message-ID: <IyLLr4.93r@igsrsparc2.er.usgs.gov>


Cgl3863 wrote:
> Typical of DBA's!!!: over complicating a simple question
> if you want the to find the current number of a given Sequence
>
> SELECT last_number FROM ALL_SEQUENCES Where Sequence_name='sequence
> name'
>
> from lazy developer
>
>

Typical of developers to think they know more than the DBA...and too lazy to read the docs....

The LAST_NUMBER column from ALL_SEQUENCES (straight from the docs) is defined as:

"Last sequence number written to disk. If a sequence uses caching, the number written to disk is the last number placed in the sequence cache. This number is likely to be greater than the last sequence number that was used."

Take special that the number is "likely to be greater than the last sequence number that was used".

Cheers!
Brian

-- 
===================================================================

Brian Peasland
oracle_dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Received on Mon May 01 2006 - 12:54:32 CDT

Original text of this message

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