Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: resetting sequence numbers
"Malik, Fawzia" wrote:
>
> Hi,
>
> Is there a way of resetting sequence numbers back to zero???The application
> we have needs to have the sequence numbers reset...
>
> Thanks in advance
>
> Rgds
>
> Fawzia
Depends on what you need really. You can make sequences cycle. Otherwise
(if you need to reset everyday for instance) either you drop and
recreate (which means that you will have to reset grants), or you can
cheat as follows :
1) You alter the sequence, setting its maxvalue to current value and
setting it to CYCLE. I think that setting CACHE to 1 could be wise too.
2) You get nextval
3) You alter the sequence back.
-- Regards, Stephane Faroult Oriole Software -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Stephane Faroult INET: sfaroult_at_oriole.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Fri Jul 05 2002 - 08:13:32 CDT