Re: Unique ID's question

From: John Jones <jmj22026_at_us1j69.glaxo.com>
Date: 1996/04/23
Message-ID: <4lih69$50i_at_ussun2n.glaxo.com>#1/1


>
>To reset sequence numbers drop and re-create sequence.
>To get more information of sequences query data dictionary view USER_SEQUENCES
>--

  I have to disagree with this. If you drop them and recreate them you have to re-grant the rights to the objects. This can be a real pain. You can use the following code to alter your sequences if you need to change the number or reset it. Let's say you have a sequence that you need to reset the number from 100 to 1.

alter sequence sequence_name increment by -99; select sequence_name.nextval from dual; 'resets the number to 1' alter sequence sequence_name increment by 1;

the next time you select on the sequence it will be '2'. Much easier than re-creating and then having to re-grant the rights.

John Jones
Oracle Consultant
jmj22026_at_us1j69.glaxo.com Received on Tue Apr 23 1996 - 00:00:00 CEST

Original text of this message