Search code examples
sqloracle-databaseoracle11gdatabase-sequence

How to make sequence jump from 100 to 150


How to fire sequence to jump from 100 to 150 and followed by 152,153 and so on . .


Solution

  • If your sequence seq1 is now at 100 and you want it to go to 150 you can:

    • Change its increment to 50.
    • Use it once.
    • Change its increment back to 1.

    In SQL terms:

    alter sequence seq1 increment by 50;
    select seq1.nextval from dual;
    alter sequence seq1 increment by 1;