编写一个给特殊雇员加薪10%的过程,这之后,检查如果已经雇佣该雇员超过60个月,则给他额外加薪3000.(注雇员表EMP,雇员号:EMPNO,薪资:SALARY)
    编写一个数据库触发器,它允许用户只在上午9.00到下午5.00之间对EMP表执行DML任务!

解决方案 »

  1.   

    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;
    /
      

  2.   

    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;