QuestionQ78

VerifiedCreating Other Schema Objects

Evaluate this CREATE SEQUENCE statement:

CREATE SEQUENCE seq1 -  
START WITH 100 -  
INCREMENT BY 10 -  
MAXVALUE 200 -  
CYCLE -  
NOCACHE;  

The SEQ1 sequence has generated values through its maximum limit of 200. You execute the following SQL statement:

SELECT seq1.nextval FROM dual;  

What does the SELECT statement display?

Explanation

For an ascending Oracle sequence, the default minimum value is 1 when MINVALUE is omitted. CYCLE makes the sequence continue after it reaches MAXVALUE; after reaching 200, the next NEXTVAL generates the minimum value, 1.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!