How to create a mysql trigger
In this article, the editor introduces in detail "how to create mysql triggers". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to create mysql triggers" can help you solve your doubts.
Description
1. Triggers are special stored procedures related to watch events that MySQL provides programmers and data analysts with methods to ensure data integrity.
Its execution is not a program call, nor a manual start, but an event trigger.
2. You can forcibly check or convert data before writing to the data table.
When an error occurs in the trigger, the abnormal result will be canceled.
Example
Create trigger
Delimiter $$create trigger trigger name before / after event (add, delete, modify) # time when the trigger is activated, the on table name for each row begin # starts executing multiple statements, with the body (now. Field) / (old. Field) # access the previous value, and the value after the visit end$$ # ends here. This article "how to create a mysql trigger" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it. If you want to know more about related articles, please follow the industry information channel.