MySQL trigger for each row, mysqltrigger

Source: Internet
Author: User

MySQL trigger for each row, mysqltrigger
For each, each row is affected and all triggers are executed, which is called a row-Level Trigger. In oracle triggers, row-level triggers and statement-level triggers can be executed only once regardless of the number of rows affected. Mysql does not support statement triggers, so you must write for each row;

Actual Operation Verification:

# TRIGGER test5: DELIMITER $ create trigger test5AFTERUPDATEON goodsFOR each rowbegin insert into 'ord 'VALUES (1, 2, 2); END $

Mysql only supports row-level triggers, and the number of rows affected will be executed.



How does the mysql trigger the entire table for each row to trigger only one row at a time? How does one trigger and change the entire table at a time?

This is not feasible because mysql triggers are row-level and can only be operated on rows.
The other method is to use a program instead of a trigger.

Oracle and mysql triggers for each row

For each row refers to the row of the database table.
See figure 1.
According to different trigger conditions, for each row is triggered when one row changes, because you can set before/after, so the specific conditions must be determined.
It's okay if you don't add it. What is your trigger?
--------------------------------
The conditions you have given are a bit vague. If you have any questions, please ask.


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.