ODAC (V9.5.15) Learning Note (19) primary key value auto-generated

Source: Internet
Author: User

The ODAC supports automatic generation of table primary key functions through Oracle's sequence. This process allows automatic completion on the client side without the need for too much code. This is useful for situations where it is required to automatically grow field keys. Its implementation steps are:

1. The database must first establish a sequence that generates a primary key.

2. Set the Keysequence property of the dataset, pointing to the sequence in the database.

3. Set the Sequencemode property of the dataset, which explicitly generates the sequence value when it is added or modified, and assigns a value to the primary key of the dataset.

4. Set the Keyfields property of the dataset and point to the key field of the table. If there are multiple fields in Keyfields, the sequence values are automatically assigned to the first field.

ODAC (V9.5.15) Learning Note (19) primary key value auto-generated

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.