-
Does anyone know the syntax for changing the next value of a sequence?
-
You have to drop and recreate the sequence to change the next value.
-
Actually there is a way to do this without dropping and recreating, but you need to be sure that no one will be using the sequence while you are doing it :
Let's say the current value of the sequence is 39, and you want to reset it to 1.
To do this, you can alter the sequence so it increments by -38, then increment it with a 'select seq.nextval from dual', and finally set the increment back to 1.
The advantage to doing it this way over dropping and recreating is that you don't have to worry about things becoming invalid
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|