Oracle PL/SQL Tutorial/Sequences/Alter Sequence

Материал из SQL эксперт
Перейти к: навигация, поиск

Altering an existing sequence

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>