create or replace trigger tr
after insert or update
on 表
for each row
begin
      --insert 语句
end;

解决方案 »

  1.   

    CREATE OR REPLACE TRIGGER 触发器名称
    AFTER INSERT OR UPDATE
    ON 表名
    REFERENCING NEW AS New OLD AS Old
    FOR EACH ROW
    DECLARE
    tmpVar NUMBER;BEGIN--说明--col 列名
    if new.Col <> old.Col and new.Col not is null  then 
    insert ...
    End if;
    --如果要做操作日志的话,可以把修改或插入的内容生成一个字符串,例如:某月某日,插入新值, “旧值1”被修改为“新值1”。。   EXCEPTION
         WHEN OTHERS THEN
           -- Consider logging the error and then re-raise
           RAISE;
    END ;/