【发布时间】:2014-10-25 11:08:26
【问题描述】:
我正在使用从 tableA 的触发器调用的过程(比如说)。在那个过程中,我正在更新另一个表,比如 tableB。但它不起作用,我没有收到任何错误,但 tableB 没有更新。请帮我解决这个问题。
触发器:用于插入前的 tableA
BEGIN
CALL his_arrear(new.Reg_No,new.Sub_Code);
END
程序:
BEGIN
DECLARE toup integer;
select count(*) into toup from tableA where Reg_No=reg and Sub_Code=scode;
update tableB set his_arrear=toup where regno=reg;
END
实际上这里程序正在执行但它没有更新tableB。
【问题讨论】:
-
15个多小时,还是没有反应……:(
-
我认为你应该在触发器
AFTER INSERT中调用Stored Procedure
标签: mysql sql database stored-procedures