oracle触发器

CREATE OR REPLACE TRIGGER TEST_TRIGGER 
BEFORE UPDATE ON TEST
FOR EACH ROW
DECLARE
  nid number(20);
  ndate date; 
BEGIN
  if :OLD.STATUS=0 and :NEW.STATUS<>0 then
     nid:=:OLD.ID;
     ndate:=:OLD.UDATE;
     INSERT INTO TEST2 VALUES(nid,ndate);
  end if;
END;

 oracle触发器

你可能感兴趣的:(oracle)