我正在尝试获取触发器以更新连接两个表的视图,其中一个表是激活导致此错误的触发器的表
INSERT INTO MC_CLUB_MBR_TRANSACTION * ERROR at line 1: ORA-04091: table ESP8339.MC_CLUB_MBR_TRANSACTION is mutating, trigger/function may not see it ORA-06512: at "ESP8339.TRG_MC_UPD_DUES", line 2 ORA-04088: error during execution of trigger 'ESP8339.TRG_MC_UPD_DUES'
这是我正在使用的代码
CREATE OR REPLACE TRIGGER TRG_MC_UPD_DUES
AFTER UPDATE OR INSERT ON
MC_CLUB_MBR_TRANSACTION
FOR EACH ROW
BEGIN
UPDATE MC_TRAN_V
SET MC_TRAN_V.DUES_DUE = (MC_TRAN_V.ANNUAL_DUES -
MC_TRAN_V.DUES_PAID_TO_DATE);
END;
/
INSERT INTO MC_CLUB_MBR_TRANSACTION
(
CLUB_CODE,
STUDENT_ID,
DUES_PAID_TO_DATE
)
VALUES
(
777,
20010,
300
);