插入后和更新触发后的MySQL [英] MySQL After Insert and After Update Trigger

查看:63
本文介绍了插入后和更新触发后的MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个表t1和t2.我在t1上插入后创建了两个触发器tr1,在t2上更新后创建了tr2.在两个表中,我正在更新表t2.因此,这将引发错误,表明t2表已经在另一个触发器中进行了更新,因此无法再次更新.

I have two tables t1 and t2. i have created two triggers tr1 after insert on t1 and tr2 after update on t2. in both the tables i m updating table t2. so, it is throwing an error saying the t2 table is already getting updated in another trigger so can not update it again.

请让我知道是否有人遇到这种类型的问题并予以解决.

Please let me know if anyone has faced this type of problem and fixed it.

提前谢谢! MySQL DBA.

Thanks in advance! MySQL DBA.

推荐答案

我已解决此问题,因为我试图通过两个触发器在同一表tb1上进行更新和插入而出现问题,但Mysql不允许使用同一表我想修改一下.

I have fixed this problem, there was a problem as i was trying to update and insert on same table tb1 from two triggers but Mysql does not allowed the same table to be modified i suppose.

谢谢

这篇关于插入后和更新触发后的MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆