Ix. The concept of MySQL triggers

Source: Internet
Author: User

  1. 1The so-called Trigger refers to an action that sets up a table (Insert,Update,Deleteat the same time, an operation that is triggered at the same time; generally used, for example, to delete the main column of the article, then you can use the trigger to delete all the articles under this article column2. Create a trigger delimiter $$Create TriggerIns_1 beforeInsert  onTt1 forEach rowBEGIN    Insert  intoTt2Values(now ()); END;    $$ above trigger, probably means: when TT1 has to insert the operation, that is to do tt2 insert operation, and then perform TT1 insert operation!! PS:: BeforeInsertInsert before executing afterInsertexecute before after insertingUpdateupdate before executing afterUpdateExecute after Update3.Drop TriggerIns_1 to delete a trigger named Ins_14. Show triggers view all triggers

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.