当colB发生变化时,我正在尝试更新lastupdate列,但是当我在触发器下面使用时,我得到了变异触发器错误,因此我也尝试使用复合触发器
create or replace trigger LASTUPDATE_TRIG
BEFORE update on TABLE_A
referencing OLD as old NEW as new
for each row WHEN (new.colB <> old.COLB)
DECLARE
V_NUMBER NUMBER;
begin
V_NUMBER := :new.COLA;
update TABLE set LAST_UPDATE_DATE = sysdate where colA= v_number;
end;
答案 0 :(得分:1)
CREATE OR REPLACE TRIGGER LASTUPDATE_TRIG
before INSERT OR DELETE OR UPDATE ON FQC_TABLE A
referencing old as old new as new
for each row
begin
if :new.COLB <> :old.COLB and updating then
:new.LAST_UPDATE_DATE:=sysdate;
end if;
end;