QuestionQ200

VerifiedCreating Other Schema Objects

You create a sequence as follows:

CREATE SEQUENCE seq1 START WITH 1;  

After selecting from it several times, you want to reinitialize it so it reissues the numbers already generated. How can you do this?

Explanation

In the applicable Oracle sequence syntax, the starting value cannot be changed with ALTER SEQUENCE. Dropping and re-creating the sequence with START WITH 1 resets its generated values. The CYCLE setting only wraps the sequence after it reaches its configured limit; it does not reset it immediately.

Learn more

Community Discussion

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