QuestionQ199

VerifiedCreating Other Schema Objects

A sequence is created as follows:

CREATE SEQUENCE seq1 MAXVALUE 50;  

If its current value is already 50, what happens when you try to select SEQ1.NEXTVAL?

Explanation

A sequence created without the CYCLE option defaults to NOCYCLE. Once it has reached its MAXVALUE of 50, it cannot produce another next value, so requesting NEXTVAL raises an error.

Community Discussion

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