Home » SQL & PL/SQL » SQL & PL/SQL » how to reset the sequence value (oracle 10.2.0.3)
how to reset the sequence value [message #309157] Wed, 26 March 2008 12:03 Go to next message
kumar.joy
Messages: 69
Registered: August 2007
Location: morrisville
Member
Hi,

for instance i have to reset the sequence value. now the sequence current values is 2000. i want to make it 0.
when i execute sequence.nextval then it should reply 1

how i can do that

Regards,
Jyothy
Re: how to reset the sequence value [message #309160 is a reply to message #309157] Wed, 26 March 2008 12:21 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Recreate the sequence.
If you want to reset it to 0 each time it raises 2000 your can give a max value and specify CYCLE.

Regards
Michel
Re: how to reset the sequence value [message #309165 is a reply to message #309157] Wed, 26 March 2008 12:58 Go to previous messageGo to next message
dasgupta.amitava@gmail
Messages: 32
Registered: November 2007
Member
Hi Jyothy,
try to follow the steps below:
1. Alter the sequence, set increment by -2000
2. Run the select sequence.nextval from dual
3. Alter the sequence, set increment by 1(or what you have set initially)


Thanks
Amit......
Re: how to reset the sequence value [message #309172 is a reply to message #309165] Wed, 26 March 2008 13:15 Go to previous message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is only valid if noone is working at the same time.

Regards
Michel
Previous Topic: Cost and Performance
Next Topic: Problem Truncating a Table
Goto Forum:
  


Current Time: Fri Dec 09 23:17:25 CST 2016

Total time taken to generate the page: 0.15926 seconds