Which clause of the CREATE SEQUENCE statement will cause the sequence to continue to generate numbers even after the maximum limit is reached?
Reveal answer
Fill a bubble to check yourself
Which clause of the CREATE SEQUENCE statement will cause the sequence to continue to generate numbers even after the maximum limit is reached?
MAXVALUE
MINVALUE
CYCLE
INCREMENT BY
The CYCLE clause causes a sequence to automatically restart from MINVALUE when MAXVALUE is reached (or from MAXVALUE when MINVALUE is reached for descending sequences). MAXVALUE sets the upper limit, MINVALUE sets the lower limit, and INCREMENT BY defines the step between values.
CYCLE is correct. In Oracle's CREATE SEQUENCE statement, the CYCLE clause tells the sequence to wrap around and start generating from MINVALUE again once it hits MAXVALUE (or MINVALUE again in descending sequences), rather than raising an error when the limit is exhausted. MAXVALUE and MINVALUE merely define the bounds — they don't cause continuation past them. INCREMENT BY just sets the step size between values. Without CYCLE (the default is NOCYCLE), the sequence would raise an ORA-08004 error upon reaching its limit.