Can I create an event in a trigger?

人盡茶涼 提交于 2019-12-22 10:06:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!