oracle 觸發器寫法(1)

CREATE OR REPLACE TRIGGER IMA_UPD
AFTER UPDATE
ON table_a REFERENCING NEW AS New OLD AS Old
FOR EACH ROW
BEGIN
   if :New.a NOT LIKE '3%' AND (:Old.b <> :New.b or :Old.b <> :New.b) then

     INSERT INTO ds4.a(c, vv, bb)
                          VALUES (:New.a1, 1, SYSDATE);
   end if;

   EXCEPTION
     WHEN OTHERS THEN
       -- Consider logging the error and then re-raise
       RAISE;
END IMA_UPD;

posted on 2011-04-07 09:30  Mayvar  阅读(197)  评论(0编辑  收藏  举报

导航