Re: on using SEQUENCE

From: Rauf Sarwar <rsarwar_at_ifsna.com>
Date: 9 Jun 2002 16:08:15 -0700
Message-ID: <c2d690f2.0206091508.504afe67_at_posting.google.com>


LinLij_at_msn.com (Lin Li) wrote in message news:<42f94837.0206081745.2fa448fb_at_posting.google.com>...
> When I CREATE SEQUENCE, and set a starting number of 1001, the first
> time I get a SEQUENCE number, it returns 1002. If I set to 1000, the
> first time I get the number, it returns 1000. I don't understand why I
> can't get 1001 as the first number.

Create sequence using the following command. CREATE SEQUENCE my_test_seq
INCREMENT BY 1
START WITH 1001
MAXVALUE 999999999999999; SQL> select my_test_seq.nextval from dual; SQL> 1001
Return value is 1000 if START WITH is 1000.

I tested this on version 8173. What is your Oracle version? Maybe you should drop the sequence and create it again if possible. Also check code to see that you are not calling currval for START WITH 1000 which will correctly return 1000. Received on Mon Jun 10 2002 - 01:08:15 CEST

Original text of this message