Evaluate the following CREATE SEQUENCE statement:
CREATE SEQUENCE seq1
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 seq1.nextval FROM dual;
What is displayed by the SELECT statement?
A.
1
B.
10
C.
100
D.
an error
The SELECT seq1.nextval FROM dual; query will display 100
The query will return 1. As they mentioned “The sequence SEQ1 has generated numbers up to the maximum limit of 200 ” . So after reaching the max value since it is cycle , again it starts from 1 and increments by 10.
should display 100 because it starts from 100.even it reached to max limit 200 ,it will recycle from 100 again.
I test it, and the next value after reached to 200, is 1. The correct answer is A
this answer is 1 because when
SELECT seq1.nextval FROM dual;
reach maxvalue 200
then restart with 1
because minvalue is not define
A
Nonsence. A realy useless feature. Why would anyone in the world need this? It is more logical to retrieve “10” instead of 1.
CYCLE option makes MINVALUE option required, and its default is 1.
The SELECT seq1.nextval FROM dual; query will display 100 . i test it
I agree with the answer. A