create or replace trigger update_null
before insert or update on boswll_temp for each row
declare
integrity_error exception;
errno integer;
errmsg char(200);
pragma autonomous_transaction;
begin
if :new.empno is not null or :new.ename is not null then
:new.empno :=null;
:new.ename :=null;
end if;
-- Errors handling
exception
when integrity_error then
raise_application_error(errno, errmsg); --抛出异常语句
end;
/