Mysql Triggers Insert and Remove in One?

I need to create insert and delete trigger, both will do the same.
Can I create this in one trigger?
Or do I need two separate ones? I looked around and everyone seems to have one for deletion and another for insertion.

+3
source share
1 answer

MySql does not allow multiple events on the same trigger.

One option is to put your code in a procedure and each trigger will call the same procedure - pass as much information as possible about the old / new line to proc.

+3
source

Source: https://habr.com/ru/post/1788463/


All Articles