Re: Triggers in MySQL 5.0.11
Hi Peter,
Instead of SHOW CREATE TRIGGER, you can do
select concat(
'create trigger',char(10)
,event_object_schema,'.',trigger_name,char(10)
,action_timing,char(10)
,event_manipulation,char(10)
,'on',char(10)
,event_object_schema,'.',event_object_table,char(10)
,'for each row'
,action_statement
)
from information_schema.triggers
You can add your own where clause to filter those triggers you want:
event_object_schema -> schema wherein the table on which the trigger is defined resides (is also the schema wherein the trigger resides)
event_object_table -> name of the table wherin the object resides
trigger_name -> name of the trigger (unique within the schema)
action_timing -> before or after
event_manipulation -> insert, update, delete
(action_timing and event_manipulation are unique per table)