gpt4 book ai didi

mysql - MySQL 存储过程默认是事务性的吗?

转载 作者:行者123 更新时间:2023-11-29 02:05:51 24 4
gpt4 key购买 nike

我有一个读取和更新多个表的 MySQL 存储过程,所以我希望它是一个事务。默认情况下它已经是事务性的了吗?或者我需要做些什么吗?

MySQL 5.0+

最佳答案

我不这么认为。根据manual section on BEGIN...END statements :

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.

另请参阅 START TRANSACTION, COMMIT, and ROLLBACK Syntax 上的手册.

关于mysql - MySQL 存储过程默认是事务性的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6171933/

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