Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Sequences

Re: Sequences

From: Lange Francois <flange_at_pt.lu>
Date: 1997/09/11
Message-ID: <34179707.547D@pt.lu>#1/1

Ed Gillispie wrote:
>
> Does any one know of a way that you can alter the starting number of a
> sequence with out dropping the sequence.
Hi,

	REM get the increment value
	column a new_value inc
	select increment_by a from user_sequences where sequence_name =
'sequence_name' ;
	REM get the how the difference to go to the value you need
	column a new_value seq_val
	select &val_you_want - sequence_name.nextval - &inc a from dual ;
	REM HOPE NOBODY TOUCH THE SEQUENCE FOR THE MOMENT.
		Alter sequence sequence_name increment by &seq_val ;
		select  sequence_name.nextval from dual ;
		Alter sequence sequence_name increment by &inc ;
	REM EVERYBODY CAN PLAY WITH THE SEQUENCE NOW
Regards François
flange_at_pt.lu Received on Thu Sep 11 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US