Home » SQL & PL/SQL » SQL & PL/SQL » SEQEUNCE
SEQEUNCE [message #316181] Thu, 24 April 2008 03:05 Go to next message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
HOW TO RESET THE SEQEUNCE?

rEGARDS
Re: SEQEUNCE [message #316182 is a reply to message #316181] Thu, 24 April 2008 03:07 Go to previous messageGo to next message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
How to post correctly?
How to search for a very frequently asked question?
How to switch caps lock off?
Re: SEQEUNCE [message #316183 is a reply to message #316181] Thu, 24 April 2008 03:12 Go to previous messageGo to next message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
Dear pablolee,

Mighe be you are angry on my FAQ, sorry for that if u hurts. actually im in hurry thatz why i wrote like that...

anyhow can anyone tell me how to reset the sequence # ?

Regards

Khaled
Re: SEQEUNCE [message #316184 is a reply to message #316183] Thu, 24 April 2008 03:21 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Push the red "Reset" button.

Just kidding; you'll have to use ALTER SEQUENCE statement and set INCREMENT BY to a negative value (calculate it as a difference between current and desired sequence value; the result might be, for example, -12345). Now, SELECT next value from the sequence to, actually, reset it and ALTER SEQUENCE again in order to set INCREMENT BY to its original value (which is, by default, 1).
Re: SEQEUNCE [message #316203 is a reply to message #316183] Thu, 24 April 2008 04:29 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
Mighe be you are angry on my FAQ, sorry for that if u hurts. actually im in hurry thatz why i wrote like that...

What is hurting is not it is FAQ (although you should search before) but that you didn't read the OraFAQ Forum Guide and don't post in UPPER CASE.

Regards
Michel
Re: SEQEUNCE [message #316206 is a reply to message #316183] Thu, 24 April 2008 04:48 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
What really is hurting is that you must have seen that you posted in all caps and did not bother to change it. Yet you expect from other people, total strangers, to put effort in helping you.
Re: SEQEUNCE [message #316234 is a reply to message #316184] Thu, 24 April 2008 06:06 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I'd just drop and recreate the sequence.
Re: SEQEUNCE [message #316253 is a reply to message #316234] Thu, 24 April 2008 07:03 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
But you have to regrant the privileges.
OK, who has privileges on a sequence but the owner?

Regards
Michel
Previous Topic: reverse key
Next Topic: Mutating Trigger
Goto Forum:
  


Current Time: Sun Dec 08 07:43:31 CST 2024