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: Sequences (default max value???)

Re: Sequences (default max value???)

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 16 Nov 1998 20:02:17 GMT
Message-ID: <36508386.10885031@192.86.155.100>


A copy of this was sent to joebrown_at_shmengie.dsj (if that email address didn't require changing) On 16 Nov 1998 13:59:19 -0500, you wrote:

>I've hunted through the documentation I have on sequences yet have not
>found a reference to the *default* maxvalue.
>
>I've instantiated a number of sequences, but never specified a
>maxvalue.
>
>Any idea if this will haunt me?

probably not. from the sql lang ref manual on 'create sequence':

MAXVALUE   specifies the maximum value the sequence can   generate. This integer value can have 28 or less   digits. MAXVALUE must be equal to or less than   START WITH and must be greater than
  MINVALUE. NOMAXVALUE
  specifies a maximum value of 10^27 for an ascending   sequence or –1 for a descending sequence.   The default is NOMAXVALUE.

Since the default is NOMAXVALUE (which is in fact an oxymoron since there is a maxvalue of 10^27 :)

SQL> create sequence foo;
Sequence created.

  1* alter sequence foo increment by 100000000000000000000000000
SQL> / Sequence altered.

SQL> select foo.nextval from dual;

   NEXTVAL



1.0000E+26

SQL> select foo.nextval from dual;

   NEXTVAL



2.0000E+26

SQL> /    NEXTVAL



3.0000E+26

SQL> /    NEXTVAL



4.0000E+26

SQL> /    NEXTVAL



5.0000E+26

SQL> /    NEXTVAL



6.0000E+26

SQL> /    NEXTVAL



7.0000E+26

SQL> /    NEXTVAL



8.0000E+26

SQL> /    NEXTVAL



9.0000E+26

SQL> /
select foo.nextval from dual
*
ERROR at line 1:
ORA-08004: sequence FOO.NEXTVAL exceeds MAXVALUE and cannot be instantiated  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Mon Nov 16 1998 - 14:02:17 CST

Original text of this message

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