Create, modify, and delete an Oracle database sequence.

Source: Internet
Author: User

Create, modify, and delete an Oracle database sequence.

1. Create a sequence

1.1 create a sequence: create sequence seqtest;

1.2 query the current Sequence Value: select seqtest. currval from dual;

1.3 next value of the query sequence: select seqtest. nextval from dual;

1.4 create a sequence with an initial value of 1, an increment of 1, and a loop | non-repeating:

Create sequence testseq increment by 1 start with 1 maxvalue 99 cycle | nocycle;

2. Modify the sequence

Alter sequence testseq minvalue 0 | maxvalue 15;

3. Delete Sequence

Drop sequence testseq;

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.