Here is my requirement, I have a mysql table on which any change (insert/delete/update) should be handled in exactly same way. According to mysql documentation create trigger syntax is as follows:
CREATE
[DEFINER = { user | CURRENT_USER }]
TRIGGER trigger_name
trigger_time **trigger_event**
ON tbl_name FOR EACH ROW
trigger_body
When I'm trying to put more than one event, its throwing syntax error. One solution is I can write one procedure and 3 triggers (one for each event) and call the same procedure from all the triggers.
Is there any sophisticated solution for this ??
See Question&Answers more detail:os