Navacate setting triggers _navacate

Source: Internet
Author: User

Navacate triggers:

Case:

When you set the TAB1 table to insert, the INSERT triggers the trigger, executing the function that the trigger writes, that is, the insert operation for the TAB2. The function is to solve when we register users in the register, at the same time to associate the Register Account table as well as the memorandum table and the ranking table.

TAB1 table:

TAB2 table

Then set up the trigger, set up in the TAB1, monitor the operation of the TAB1 table, and write the function of the corresponding action to the TAB2 table. (Inserts a record with the Insert function in Tab1, then monitors the INSERT function with a trigger, and the trigger feature inserts the TAB2 when the insert Tab1 to the operation.) )

Right-click tab1-> Design Table-"trigger, trigger name itself, trigger for after (before to see what the specific insert operation wants), and then click Insert (on behalf of trigger insert). (as pictured above)

Then define the box to write the trigger function. Begins with begin, end ends, middle writes specific triggering function (insert into TAB2 (uid,name) VALUES (New.id, "");). The last error, the TAB1 to perform the insert operation, TAB2 will also be inserted (written in the picture), tab2 in the UID is equal to the UID in TAB1.

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.