Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sequences (default max value???)
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 100000000000000000000000000SQL> / Sequence altered.
SQL> select foo.nextval from dual;
NEXTVAL
SQL> select foo.nextval from dual;
NEXTVAL
SQL> / NEXTVAL
SQL> / NEXTVAL
SQL> / NEXTVAL
SQL> / NEXTVAL
SQL> / NEXTVAL
SQL> / NEXTVAL
SQL> / NEXTVAL
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
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
![]() |
![]() |