DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Sequences URGENT!

  1. #1
    Join Date
    Oct 2000
    Location
    Halifax, Nova Scotia
    Posts
    197
    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

  2. #2
    Join Date
    Nov 2000
    Posts
    224
    Yes It will

  3. #3
    Join Date
    Aug 2000
    Posts
    194
    I believe you have to drop the sequence and recreate it with "START WITH" option to start from another value ;

  4. #4
    Join Date
    Aug 2000
    Posts
    194
    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 ;



  5. #5
    Join Date
    Jul 2000
    Posts
    296
    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.

  6. #6
    Join Date
    Oct 2000
    Location
    Halifax, Nova Scotia
    Posts
    197
    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
  •  


Click Here to Expand Forum to Full Width