gpt4 book ai didi

mysql - MsSql 计划触发的事件

转载 作者:行者123 更新时间:2023-11-29 18:30:34 25 4
gpt4 key购买 nike

我已经注册了一个事件调度程序,每周一运行,并完成了谷歌搜索要求遵循的所有步骤。 。我已将服务器日期回溯到星期一日期。但该事件仍然没有被触发。

第 1 步设置均匀调度程序:

SET GLOBAL event_scheduler = ON;

第 2 步创建事件:

CREATE EVENT ScheduledFaMeetingTableUpdate
ON SCHEDULE
EVERY 1 WEEK
STARTS CURRENT_DATE + INTERVAL 0 - WEEKDAY(CURRENT_DATE) DAY + INTERVAL 10 HOUR
DO
Call FAMeetingWeekUpdate_sp();

SELECT @@global.event_scheduler;
Result : ON

Show Events;
Result :
'bitnami_redmine', 'ScheduledFaMeetingTableUpdate', 'root@localhost', 'SYSTEM', 'RECURRING', NULL, '1', 'WEEK', '2017-08-14 10:00:00', NULL, 'ENABLED', '0', 'utf8', 'utf8_general_ci', 'utf8_general_ci'


SHOW PROCESSLIST;
Result :
'1', 'event_scheduler', 'localhost', NULL, 'Daemon', '-65135', 'Waiting for next activation', NULL

最佳答案

您尚未指定该事件应一次又一次执行。

来自manual :

Normally, once an event has expired, it is immediately dropped. You can override this behavior by specifying ON COMPLETION PRESERVE. Using ON COMPLETION NOT PRESERVE merely makes the default nonpersistent behavior explicit.

您的创建事件语句应如下所示:

CREATE EVENT ScheduledFaMeetingTableUpdate
ON SCHEDULE
EVERY 1 WEEK
STARTS CURRENT_DATE + INTERVAL 0 - WEEKDAY(CURRENT_DATE) DAY + INTERVAL 10 HOUR
ON COMPLETION PRESERVE
DO
Call FAMeetingWeekUpdate_sp();

关于mysql - MsSql 计划触发的事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45726766/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com