Create or replace trigger trig_error
before insert or update or delete on emp
begin
if to_char(sysdate,'DY') IN ('SAT','SUN') then
raise_application_error(-20111,'No changes can be made on tuesday');
end if;
end;
dbms_output.put_line('no changes can be done on SAT and SUN!!’);
但是得到这样的输出:警告:触发器创建时出现编译错误。