Altering an existing sequence : Alter Sequence « Sequences « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> CREATE SEQUENCE test_seq;

Sequence created.

SQL>
SQL> SELECT test_seq.nextval FROM DUAL;

   NEXTVAL
----------
         1

SQL> SELECT test_seq.nextval FROM DUAL;

   NEXTVAL
----------
         2

SQL> SELECT test_seq.nextval FROM DUAL;

   NEXTVAL
----------
         3

SQL>
SQL>
SQL> ALTER SEQUENCE test_seq MAXVALUE 10;

Sequence altered.

SQL>
SQL> SELECT test_seq.nextval FROM DUAL;

   NEXTVAL
----------
         4

SQL> SELECT test_seq.nextval FROM DUAL;

   NEXTVAL
----------
         5

SQL> SELECT test_seq.nextval FROM DUAL;

   NEXTVAL
----------
         6

SQL> SELECT test_seq.nextval FROM DUAL;

   NEXTVAL
----------
         7

SQL> SELECT test_seq.nextval FROM DUAL;

   NEXTVAL
----------
         8

SQL> SELECT test_seq.nextval FROM DUAL;

   NEXTVAL
----------
         9

SQL>
SQL>
SQL>
SQL> DROP SEQUENCE test_seq;

Sequence dropped.

SQL>








5.7.Alter Sequence
5.7.1.Altering an existing sequence