Computer >> Computer tutorials >  >> Programming >> MySQL

How can we see the information on triggers order in case of multiple triggersfor same event and action time?


It can be done with the help of the following query −

mysql> SELECT trigger_name,action_order FROM INFORMATION_SCHEMA.triggers WHERE TRIGGER_SCHEMA = 'query' ORDER BY event_object_table,action_timing,event_manipulation;
+------------------------------+--------------+
| trigger_name                 | action_order |
+------------------------------+--------------+
| studentdetail_before_update  |            1 |
| studentdetail_before_update2 |            2 |
+------------------------------+--------------+
2 rows in set (0.10 sec)

The above result set shows the order of multiple triggers created on the same event and action time in the database ‘query’.