mysql - mysql 事务可以在 mysql 事件调度程序中完成吗?

标签 mysql transactions mysql-event

我想根据另一个表的开始日期更新 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 a BEGIN ... END block. Begin a transaction in this context with START TRANSACTION instead.

(强调我的)

这表明您可以在事件中启动并提交事务。但出于语法解析的原因,不要使用 BEGIN 启动事务。

关于mysql - mysql 事务可以在 mysql 事件调度程序中完成吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26450634/

相关文章:

mysql - 一段时间后重置列值

iOS 和 Mysql 事件

php - 当我调用包含 mysql 连接的函数时出错

java - 从关闭文件方法抛出 IOException 时如何管理事务(包括文件 IO)

database - SQLite 是否支持跨多个数据库的事务?

python - Google App Engine : How to do queries interact when they execute a function decorated by ndb. 事务

mysql - 10分钟后触发(MySql)

php - 数据库名称 PDO 问题

php - 当数据库连接/未连接时,如何使用 MySQL/PHP 显示不同的图像?

mysql - 使用联合从多个表中选择计数相关行