What is displayed by the SELECT statement?

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?

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



Leave a Reply 4

Your email address will not be published. Required fields are marked *


KPD

KPD

I am quite sure that the nextval would be 10. The increment is 10 and there is not “start with” clause included.

KPD

KPD

Nope, 1 is correct. The default start value of all sequences is 1. 🙂

Milan

Milan

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

Exmr

Exmr

Test on Oracle 11g R1:

CREATE SEQUENCE seql START WITH 100 INCREMENT BY 10 MAXVALUE 200 CYCLE NOCACHE;
SELECT seql.nextval FROM dual;

100