Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the maximum value of MAXVALUE in sequence in oracle?

Tags:

Could you tell me what is the maximum/minimum value of MAXVALUE in a sequence & what is the minimum/maximum value of MINVALUE in sequence?

like image 571
user1252398 Avatar asked Mar 07 '12 04:03

user1252398


People also ask

What is the maximum value in a number sequence?

The defaults are 1 and -2147483647 for ascending and descending sequences, respectively. The optional clause MAXVALUE maxvalue determines the maximum value for the sequence. The defaults are 2147483647 and -1 for ascending and descending sequences, respectively.

What happens when a sequence reaches the Maxvalue and the cycle values is set?

This is the default. CYCLE Specify CYCLE to indicate that the sequence continues to generate values after reaching either its maximum or minimum value. After an ascending sequence reaches its maximum value, it generates its minimum value. After a descending sequence reaches its minimum, it generates its maximum value.

How do I find the maximum value of a sequence in SQL?

seq = (select max(t2. seq) from t t2 where t2.


2 Answers

http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_6015.htm

MAXVALUE Specify the maximum value the sequence can generate. This integer value can have 28 or fewer digits. MAXVALUE must be equal to or greater than START WITH and must be greater than MINVALUE.

MINVALUE Specify the minimum value of the sequence. This integer value can have 28 or fewer digits. MINVALUE must be less than or equal to START WITH and must be less than MAXVALUE.

 CREATE SEQUENCE supplier_seq  MINVALUE 1  MAXVALUE 999999999999999999999999999  INCREMENT BY 1; 
like image 159
Vishwanath Dalvi Avatar answered Oct 14 '22 12:10

Vishwanath Dalvi


Max value is limited to 28-digits only.

like image 43
Kundan Kumar Avatar answered Oct 14 '22 11:10

Kundan Kumar