我想根据另一个表的开始日期更新 3 个表。因此,我生成一个事件调度程序,它检查该表中的开始日期和当前日期。了解是否可以在事件调度程序中创建事务将有很大帮助
最佳答案
http://dev.mysql.com/doc/refman/5.6/en/commit.html说:
Within all stored programs (stored procedures and functions, triggers, and events), the parser treats
BEGIN [WORK]
as the beginning of aBEGIN ... END
block. Begin a transaction in this context withSTART TRANSACTION
instead.
(强调我的)
这表明您可以在事件中启动并提交事务。但出于语法解析的原因,不要使用 BEGIN
启动事务。
关于mysql - mysql 事务可以在 mysql 事件调度程序中完成吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26450634/