Evaluate the following CREATE SEQUENCE statement: CREATE SEQUENCE seql
START WITH 100 INCREMENT BY 10 MAXVALUE 200 CYCLE NOCACHE; The sequence
SEQ1 has generated numbers up to the maximum limit of 200. You issue the following SQL
statement: SELECT seql.nextval FROM dual; What is displayed by the SELECT statement?
A.
an error
B.
100
C.
1
D.
10
I am quite sure that the nextval would be 10. The increment is 10 and there is not “start with” clause included.
Nope, 1 is correct. The default start value of all sequences is 1. 🙂
I think C is correct because after reach of MAXVALUE the CYCLE sequence continues with the MINVALUE. In this sequence ist MINVALUE not defined, so the default is 1
Test on Oracle 11g R1:
CREATE SEQUENCE seql START WITH 100 INCREMENT BY 10 MAXVALUE 200 CYCLE NOCACHE;
SELECT seql.nextval FROM dual;
100