我有这么简单的触发器。我没有编译错误。
CREATE OR replace TRIGGER test_triger
BEFORE INSERT OR UPDATE ON users
FOR EACH ROW
DECLARE
varii NUMBER;
BEGIN
SELECT Count(dur.id)
INTO varii
FROM users dur
WHERE dur.id = :old.id
OR dur.id = :new.id;
IF( varii > 0 ) THEN
Raise_application_error(-20001, 'error!, ');
END IF;
END;
当我调用更新时,我有这样的错误:
TEST.USERS is mutating, trigger/function may not see it.
这是什么意思?
ORA-04091,ORA-06512和ORA-04088错误。