Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE : RE: Dropping & re-Creating Sequences in PL/SQL
A clever way was shown to me by Indian friend of mine in Singapore, by
altering the sequence to make the maxvalue be the current one and to
define it to 'cycle', then get the nextval and of course reset nocycle
and maxvalue unlimited. The advantage of altering the sequence, as
opposed to drop/create, is that you do not have to worry about granting
SELECT on it again, etc. etc. Great for resetting dayly counters. Not
certain about the invalidation of stored procedures referencing it
though. Would tend to say that it invalidates them but I have not
checked.
-- Regards, Stephane Faroult email: sfaroult_at_oriolecorp.com Oriole Corporation Voice: +44 (0) 7050-696-269 Fax: +44 (0) 7050-696-449 Performance Tools & Free Scripts ------------------------------------------------------------------ http://www.oriolecorp.com, designed by Oracle DBAs for Oracle DBAs ------------------------------------------------------------------ >>Received on Tue Jul 04 2000 - 09:22:33 CDT
> How would you reset the sequence? From Oracle 8i SQL reference "to restart the sequence from the different number you must drop and recreate the sequence".