According to oracle documentation, to change a value of a sequence, you have to drop and recreate it, using the following command:
CREATE SEQUENCE table_name_seq START WITH 12345;
But there are some easy ways to change the value of an existing sequence too.
If you want to increment the current value by 500, you can just use
select your_sequence_name.nextval from dual connect by level <= 500;
If you want to decrement it, you can do that as follows:
alter sequence id_sequence increment by -500;
select id_sequence.nextval from dual;
alter sequence id_sequence increment by 1;
(of course this can also be used to increment it, but the connect by level
trick is easier then)
Comments
Add comment