日期:2014-05-16  浏览次数:20572 次

用触发器实现在归定时间内不能修改数据
用触发器实现在归定时间内不能修改数据!如果修改抛出一个异常!(注意:自定义异常号段为.20000到21000.
create or replace trigger trg_IU
? before insert or update or delete on table_bill?
? for each row
declare
? v_str varchar2(10);
begin
if inserting then
v_str:='insert';
else
v_str:='update';
end if;
insert into lyx(t_name) values(v_str);
? if(to_char(sysdate,'hh24:mi') between '08:00' and '18:00') then
? raise_application_error(-20510,'hello a! ');
? end if;
end trg_IU;