我刚开始使用 SQL 并遇到问题:我想编写一个更新前触发器,但是当我尝试更新表时,我总是得到那个错误 (ORA-04091)。我真的不明白为什么;因为我认为更新前的触发器对变异表没有问题。
BEFORE UPDATE ON ORD
FOR EACH ROW
DECLARE
shipping2 varchar(10);
BEGIN
SELECT SHIPDATE into shipping2
FROM ORD
WHERE ORDID = :old.ORDID;
IF (shipping2 is not NULL) then
raise_application_error(20121,'ORDER already on the way!!!');
end if;
END;
-------------------------------------------------------
UPDATE ORD
SET TOTAL = 222
WHERE ORDID = 603;