--触发器
create trigger say--replace
after insert--before delete update
on pro_test
declare
begin
dbms_output.put_line('lalalalaal');
--行级触发器、列级触发器
--for each rows[where]
end;
insert into pro_test(id,name,money) values(100,'wangsan',900)
--复杂安全性检查
create or replace trigger anquan
before insert
on pro_test
declare
begin
if to_char(sysdate,'day') in ('星期六','星期日') or
to_number(to_char(sysdate,'hh24')) not between 9 and 18 then
--raise 抛出数据库错误
raise_application_error(-20001,'fuck');
--抛出程序异常 代码在-20000到-29999
end if;
end;
--数据的确认
create or replace trigger queren
before update
on pro_test
for each row
declare
begin
if :new.money<:old.money then
raise_application_error(-20002,'fuck you');
end if;
end;
--数据的审计 日志
create trigger anquan
--insert....
--数据的备份与同步
create trigger tongbu
after update
on pro_test
for each row
declare
begin
if then
end if;
end;