1、触发器(特殊的存储过程)的应用场景:1.复杂的安全性检查;2.数据确认;3.实现审计功能;4.完成数据的备份和同步;
2、触发器的类型:语句级触发器和行级触发器
3、创建触发器语法:
CREATE OR REPLACE TRIGGER trigger_name
{BEFORE|AFTER}
{DELETE|INSERT|UPDATE[OF 列名]}
ON table_name
[FOR EACH ROW [WHEN(条件)]]
PLSQL块;
eg:create or replace trigger tri_vio_violation_in
before insert on vio_violation_in for each row
declare
begin
if
:new.ryfl = '2' then :new.hpzl :='无';
end if;
end tri_vio_violation_in;