Creation and use of oracle sequence, creation of oracle Sequence

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.