这是
CYCLE关键字的用例;报价
indicate that the sequence continues to generate values after reaching either its maximum or minimum value. After an ascending sequence reaches its maximum value,it generates its minimum value. After a descending sequence reaches its minimum,it generates its maximum value.
您的对象声明应该变为:
CREATE SEQUENCE idctr_seq
MINVALUE 1
MAXVALUE 99
START WITH 1
INCREMENT BY 1
CACHE 10
CYCLE;
这是一个较小序列的演示
SQL> create sequence test_seq start with 1 maxvalue 3 nocache cycle;
Sequence created.
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> select test_seq.nextval from dual;
NEXTVAL
----------
1