问题
Is it possible to create a new event from inside a trigger?
It's not something I'd particularly recomment, but I'm just wondering if it can be done.
I would like to fire a insert in response to an update, but have the insert be done delayed.
Right now I insert a value into a temp table and have a predefined event sweep that table every x minutes.
However this seems wasteful because most of the time there's nothing to do.
If I cannot create the event, can I at least enable/disable it on the fly?
回答1:
You cannot create an event from a stored procedure or trigger.
>If I cannot create the event, can I at least enable/disable it on the fly?
ALTER EVENT event1 ENABLE;
ALTER EVENT event1 DISABLE;
CREATE EVENT Syntax
来源:https://stackoverflow.com/questions/7510494/can-i-create-an-event-in-a-trigger