create or replace trigger tr_u_emp before update on emp for each row begin if to_char(sysdate,'hh24') between '09' and '17' then null; else raise_application_error(-20001,'此时间段不允许DML'); end if; end; /
update emp set salary = salary * 1.1 where empno = :empno; update emp set salary = salary + 3000 where empno = :empno and months_between(sysdate , hiredate) > 60;
before update on emp
for each row
begin
if to_char(sysdate,'hh24') between '09' and '17' then
null;
else
raise_application_error(-20001,'此时间段不允许DML');
end if;
end;
/
update emp set salary = salary + 3000 where empno = :empno and months_between(sysdate , hiredate) > 60;