select elsif 选出员工工资根据类型加薪
create or replace procedure Proc_emp_salary is

c_manager constant number :=0.1;
c_salesman constant number :=0.3;
v_job varchar(100);
begin
select job into v_job
from emp where emp.empno='7566';
if v_job='SALEMAN'
then
update emp t set t.sal=t.sal*(1+c_manager) where empno='7566';
elsif v_job ='MANAGER'
then
update emp t set t.sal=t.sal*(1+c_salesman) where empno='7566';
end if;

dbms_output.put_line(v_job);
exception
when no_data_found
then
dbms_output.put_line('没有找到数据');


end Proc_emp_salary;

相关文章:

  • 2021-06-11
  • 2021-07-09
  • 2022-01-14
  • 2022-02-07
  • 2021-05-29
  • 2021-11-29
  • 2021-10-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2021-09-12
  • 2021-05-07
相关资源
相似解决方案