-
I have 2 sequences A and B that are used to create security accounts on my system. Now the developers want to drop one of the sequences and only use one to create accounts. My problem is that the one they are dropping has the higher number between of the 2 sequences and these numbers can't be used over again
Ex Sequence A Last number = 12
Sequence B Last number = 8
and A is being dropped.
Is it possible to just alter sequence B so that the min value is now higher than that of sequence A .
Will this cause B to start off above A the next time the sequence is accessed.
Any info will be a help
Thanks
Don't be afraid to try something new. Amateurs built the Ark, professionals built the Titanic
-
-
I believe you have to drop the sequence and recreate it with "START WITH" option to start from another value ;
-
or,
You can just do some select and bump up the value of sequence B to reach the lastnumber (or last number +1 ) of A.
ex:
select B.nextval from dual ;
select B.nextval from dual ;
-
If currval of sequence B is 8, you cannot set minvalue to 12. Minvalue cannot be made to exceed the current value.
Best option is to recreate the sequence with START WITH value the currval of sequence A +1.
You can also ALTER the sequence and set INCREMENT BY to the the difference between A.currval and B.currval, do one SELECT B.NEXTVAL FROM dual, and ALTER sequence again and set INCREMENT BY back to 1.
-
Thanks alot guys
I dropped it and used the START WITH clause and now everything is fine
Thanks for all your suggestions
Don't be afraid to try something new. Amateurs built the Ark, professionals built the Titanic
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
|