Oracle's serial number (sequence)

Source: Internet
Author: User

For Oracle's self-increment column, use the serial number (sequence).

Initialization phase to manually establish a sequence, and then insert the time, but also to manually read the sequence nextval assigned to the relevant fields, such as ID, the trouble is very. The advantage is that we know this ID value before the record is inserted, and sometimes it is easier to handle the master-slave table. But this is not a problem for SQL Server and can be obtained.

Oracle This serial number, there is a cache such an east, the default is a one-time generation of 20, can not be lost, may cause the ID is inconsistent. What's more, it can sometimes cause misunderstanding.

Like, I have a stored procedure that uses a serial number.

The stored procedure can then be executed manually or entrusted to the job. Because there is a cache, the job is to take 20 first, at their own pace to insert, if you also record the timestamp, you will find, how some of the ID value is small, its execution time is the latest? The reason for this is that the ID and the order in the impression do not match.

In this case, the ID will lose the time associated with the reference property, but also simply use the GUID to master the key good. GUID, the table cross-database can ah. But in SQL Server, there seems to be no such problem.

http://www.woaipu.com/shops/zuzhuan/61406
http://nanning.xjwy.cn/f/bencandy.php?fid=43&id=117777
http://nanning.xjwy.cn/f/bencandy.php?fid=43&id=117890
http://nanning.xjwy.cn/f/bencandy.php?fid=43&id=117994
http://nanning.xjwy.cn/f/bencandy.php?fid=43&id=118376

Oracle's serial number (sequence)

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.