Knowledge about primary key and rowid of data tables in Oracle Development

Source: Internet
Author: User

1. Simple Explanation of primary key and rowid
Primary Key: The primary key is unique and not empty. It is used to identify a unique record.
Rowid: the actual physical address of the Data. You do not have to create a rowid yourself. You do not have the permission to create a rowid, which is an index generated by the Oracle system.
2. Can rowid be used as the primary key?
Yes. You can query the rowid field of any table during SELECT query.
3. When will rowid be used?
In my personal experience, since rowid can be used as a primary key, it can replace the Union primary key operation. After all, it is troublesome to use the Union primary key.
4. The rowid technique used in the actual program:
The front-end gridview displays the queried data, including querying, adding, deleting, and modifying database tables.
When querying data, you can also query the rowid field of the data. The rowid does not need to be displayed (as a hidden column), but can be hidden, especially when deleting or modifying data, you can directly use rowid. There are two advantages: one is that you can modify the value of the primary key, and the other is that modification and deletion are efficient and fast. Especially when a primary key is associated.

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.