Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: ALTERing a sequence's min value

Re: ALTERing a sequence's min value

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: 2000/05/22
Message-ID: <39294165.D374F7B3@edcmail.cr.usgs.gov>#1/1

> No because you can't alter a sequence's minvalue

You can alter a sequence's minvalue. See the example below.

SQL> CREATE SEQUENCE testseq START WITH 10 INCREMENT BY -1   2 MINVALUE 9 MAXVALUE 100; Sequence created.

SQL> SELECT testseq.nextval FROM DUAL;

   NEXTVAL


        10

SQL> SELECT testseq.nextval FROM DUAL;

   NEXTVAL


         9

SQL> SELECT testseq.nextval FROM DUAL;
SELECT testseq.nextval FROM DUAL
*
ERROR at line 1:
ORA-08004: sequence TESTSEQ.NEXTVAL goes below MINVALUE and cannot be instantiated

REQ SQL> ALTER SEQUENCE testseq MINVALUE 0;

Sequence altered.

REQ SQL> SELECT testseq.nextval FROM DUAL;

   NEXTVAL


         8

HTH,
Brian

-- 
========================================
Brian Peasland
Raytheons Systems at
  USGS EROS Data Center
These opinions are my own and do not
necessarily reflect the opinions of my 
company!
========================================
Received on Mon May 22 2000 - 00:00:00 CDT

Original text of this message

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