--头部文件 CREATE OR REPLACE TRIGGER tri_test AFTER INSERT OR DELETE OR UPDATE ON 表 FOR EACH ROW--执行段 BEGIN if inserting then insert into c values(:new.a01,:new.a02,:new.a03); elsif updating then update c set b02=:new.a02,b03=:new.a03 where b01=:old.a01; elsif deleting then delete from c where b01=:old.a01; end if; EXCEPTION WHEN others THEN null; END;
--头部文件
CREATE OR REPLACE TRIGGER tri_test
AFTER INSERT OR DELETE OR UPDATE
ON 表
FOR EACH ROW--执行段
BEGIN
if inserting then
insert into c values(:new.a01,:new.a02,:new.a03);
elsif updating then
update c set b02=:new.a02,b03=:new.a03 where b01=:old.a01;
elsif deleting then
delete from c where b01=:old.a01;
end if;
EXCEPTION
WHEN others THEN
null;
END;