我正在尝试在 oracle 数据库上创建触发器,但我遇到了 when 条件的问题。当我尝试使用它时,我得到“无效的关系运算符”
create or replace TRIGGER SQLTEST.TRIGGER_TESTE
AFTER INSERT OR UPDATE ON SQLDBA.VT_TABLE
FOR EACH ROW
WHEN (INSERTING OR NEW.FIELD_1 is null and OLD.FIELD_1 is not null or NEW.FIELD_1 <> OLD.FIELD_1)
DECLARE
VAR_FIELD_1 VT_LOG_TABLE.FIELD_1%TYPE;
BEGIN
SELECT SQLDBA.SEQ_LOG_TABLE.NEXtval into VAR_FIELD_1
FROM dual;
INSERT INTO VT_LOG_TABLE
(FIELD_0,VAR_FIELD_1,FIELD_2,FIELD_3,FIELD_1, FIELD_4 )
VALUES( :NEW.FIELD_0,VAR_FIELD_1, :NEW.FIELD_2, :NEW.FIELD_3, :NEW.FIELD_1,SYSDATE);
END TRIGGER_TESTE;
产生这种情况的正确方法是什么?