Inserting nextval after sequence has reached maximum value
What will happen when a sequence has reached the maximum value and we try to insert the nextval of the sequence?
Eg. A sequence has a maximum value of 999 and it has crossed. Now i try to insert a value through sequence_name.nextval() and the cycle option was not mentioned while creating the sequence.
Will oracle give a error?
[B]Question asked by visitor sgmakwana[/b]
Re: Inserting nextval after sequence has reached maximum value
Hi,
Oracle will definitely throw an error if the sequence exceeds the max value & cycle parameter is not set.
The error will be ORA-08004,
[B]ORA-08004: sequence SEQ_TEST1.NEXTVAL exceeds MAXVALUE and cannot be instantiated[/B]
Re: Inserting nextval after sequence has reached maximum value
well innila gave the correct reply. if the paramater for returning to the starting value is off then an error will be there else if cycle is present then it ll start from the beginning value. like if we have start value 1
max value 99
then if cycle is there then after 99 it ll start from 1 else will return a value.
Re: Inserting nextval after sequence has reached maximum value
i mean ll return a error. hope u get that
Re: Inserting nextval after sequence has reached maximum value
try with ALTER SEQUENCE and change the max val property or SET CYCLE property
Re: Inserting nextval after sequence has reached maximum value
Yes oracle will return an error message.
Re: Inserting nextval after sequence has reached maximum value
yes,oracle will surely throw an error.
Re: Inserting nextval after sequence has reached maximum value
ORA-08004: sequence ASHISH.NEXTVAL exceeds MAXVALUE and cannot be instantiated
This is the error oracle will throw