暂无图片
MySQL在创建触发器使用after inert后 进行原表的数据更新报错
我来答
分享
清晨到日暮
2021-06-29
MySQL在创建触发器使用after inert后 进行原表的数据更新报错

MySQL在创建触发器使用after inert后 进行原表的数据更新报错
image.png
Error Code: 1442. Can’t update table ‘user_cost’ in stored function/trigger because it is already used by statement which invoked this stored function/trigger.

我来答
添加附件
收藏
分享
问题补充
1条回答
默认
最新
Cui Hulong

以上这个错误是因为:在一个表user_cost的触发器中不能insert/update/delete这个表user_cost

A stored function or trigger cannot modify a table that is already being used (for reading or writing) by the statement that invoked the function or trigger.
存储的函数或触发器不能修改已被调用函数或触发器的语句使用(用于读写)的表。

https://dev.mysql.com/doc/refman/5.7/en/stored-program-restrictions.html

暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏