Creation and use of oracle sequence, creation of oracle Sequence
Create sequence demo_s:
Create sequence demo_sminvalue 1000 maxvalue 999999999999999999 start with 1000 increment by 1 cache 20;
Explanation:
Increment by: Specifies the sequence growth step. It can be positive (ascending) or negative integer (descending), but cannot be 0. The highest precision is 28.
Start with: Specifies the START number of a sequence. The default value is the minimum value of the sequence.
MAXVALUE: specifies the maximum value of a sequence. A maximum of 28 BITs are supported. Must be greater than or equal to the starting value and greater than or equal to the minimum value of the sequence.
NOMAXVALUE: no maximum value (actually 10 ^ 27 or-1 ). Default
MINVALUE: specifies the minimum value of a sequence.
NOMINVALUE: no minimum value (actually 1 or-10 ^ 26 ). Default
CYCLE: Specify the sequence to be generated from the beginning after it reaches the maximum or minimum value.
NOCYCLE: non-circular generation. Default.
CACHE: specifies the number of pre-allocated sequence values in the database memory for quick acquisition. The minimum cache value is 2.
Sequence:
Select demo_s.nextval from dual;
Demo_s.nextval is the Sequence Value of auto-increment.