Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: resetting sequence numbers
this is probably the best way coz you wouldn't have you triggers, etc. invalidated.
good trick. live and learn. :)
btw, that's good to temporarly revoke all the select privileges on sequence if you cannot guarantie that no one will select from it... or else this trick could play a bad joke.
Alexandre
Its as simple as:
get the most current value.
alter the sequence to make the increment the negative value of that.
select from the sequence
alter the sequence increment back to normal.
If you need an example/specifics, email me direct.
Joe
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Alexandre Gorbatchev
INET: alexandre.gorbatchev_at_avermann.de
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:38:33 CDT