The next number value of Oracle's sequence __oracle

Source: Internet
Author: User


Best Answer

Nextnumber is the beginning of the next value to be cached by the sequence. That is, the number behind the cache buffer, if cache10, the next nextnumber is 11

Nextval is the sequence that takes out the next value, and every time it is fetched, it accumulates once

1 2 3 4 5 6 CREATE SEQUENCE Seq_user INCREMENT by 1--add a few start with 1 at a time--counting Nomaxvalue from 1--not setting the maximum nocycle--has been cumulative, Do not cycle CACHE 10;

The test code is as follows:

1 2 3 4 Select Seq_user.nextnumber from dual;   --Returns 1 select Seq_user.nextnumber from dual;     --Return one select Seq_user.nextval from dual;     --Returns 1 select Seq_user.nextval from dual; --Return 2
Best Answer

Nextnumber is the beginning of the next value to be cached by the sequence. That is, the number behind the cache buffer, if cache10, the next nextnumber is 11

Nextval is the sequence that takes out the next value, and every time it is fetched, it accumulates once

1 2 3 4 5 6 CREATE SEQUENCE

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.