MYSQL Trigger Personal records

Source: Internet
Author: User

Students to write a trigger, a little help him to study the next

The following is primarily a personal guess to understand

Main Talk Update

When we create the trigger, the database listens for events on the table that created the trigger.

When an update operation occurs for a record in the table:

-The database uses old to store older records before the update is performed.

-Perform update.

-After the update succeeds, use new to store (or point to) the record.

As a result, we can access the old record by using the OID field name to access the new record by using new . Field name . Both old and new refer to records in the Update table.

See online someone said update, will generate two tables, one is deleted one is inserted, should be right.

The actual application of trigger seems to be very few? It seems like the general application is to achieve trigger operation, feel more simple and flexible.

More specific principles, and so on when the time to study again. Let's record a little bit.

MYSQL Trigger Personal records

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.