Oracle uses relevant triggers to implement auto-incremental ID

Source: Internet
Author: User


The following article describes how to use relevant triggers to implement auto-increment IDs in Oracle. The actual steps for implementing auto-increment effects for IDs in the userinfo table are as follows, if you are interested in the actual operation steps, the following article will further increase your interest in tb. 1. create a sequence code -- create sequence Create sequence seq_userinfo minvalue 1 www.2cto.com start with 1 increment by 1; 2. create trigger code create or replace trigger tigger_userinfo before insert on userinfo for each row declare begin select SEQ_userinfo.nextval into: New. id from dual; end tigger_userinfo; prepared by tbwshc

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.