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: Weird SEQUENCE Problem

Re: Weird SEQUENCE Problem

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 01 Mar 2007 11:49:55 -0800
Message-ID: <1172778592.953769@bubbleator.drizzle.com>


TJ wrote:
> I have a sequence that is defined correctly. According to TOAD, the
> Last Value generated by the sequence is '21'.
>
> However, when I execute:
>
> SELECT MY_SEQUENCE.NEXTVAL FROM DUAL;
>
> The value is '1'. If I do it again, then the value is '2'. Obviously,
> I can continue to do this until I get the number I want, but why is
> NEXTVAL returning me the wrong number?
>
> One thing that may help... I believe that the sequence is resetting
> to '1' when we bring the DB down and restart it. I haven't proven this
> yet, but this has been a problem that recurs intermittently and that
> is my theory at this point.
>
> Thanks.
>
> TJ

Nothing weird. Oracle is doing exactly as documented.

By default a sequence cache's 20 numbers. The next time the sequence generates numbers it will start with 21.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Thu Mar 01 2007 - 13:49:55 CST

Original text of this message

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