- Forum
- Databases
- Oracle Inserting nextval after sequence has reached maximum value
-
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?
Question asked by visitor sgmakwana
-
Expert Member
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,
ORA-08004: sequence SEQ_TEST1.NEXTVAL exceeds MAXVALUE and cannot be instantiated
-
Junior Member
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.
-
Junior Member
Re: Inserting nextval after sequence has reached maximum value
i mean ll return a error. hope u get that
-
Junior Member
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.
-
Junior Member
Re: Inserting nextval after sequence has reached maximum value
yes,oracle will surely throw an error.
-
Junior Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules