-----Original Message-----
Dear Mr.Akaplan,
How are you? How do you re-set a sequence ie.initial value? Thank
you!
Best regards,
Kinny
-------- Reply -----------
Kinny,
Let's say that you create and increment a sequence:
SQL> CREATE SEQUENCE X;
Sequence created.
SQL> SELECT X.NEXTVAL FROM DUAL;
1
SQL> SELECT X.NEXTVAL FROM DUAL;
2
SQL> SELECT X.NEXTVAL FROM DUAL;
3
SQL> SELECT X.NEXTVAL FROM DUAL;
4
SQL> SELECT X.NEXTVAL FROM DUAL;
5
To reset the value:
SQL> alter sequence x increment by -4;
Sequence altered.
SQL> SELECT X.NEXTVAL FROM DUAL;
1
SQL> alter sequence x increment by 1;
Sequence altered.
SQL>
There you have it. By changing the INCREMENT BY clause, you can change the value
of the sequence to anything you want.
Best regards,
-Ari Kaplan
www.arikaplan.com
Back to Ari Kaplan's Home Page