存储过程else if

Posted shejiewei

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了存储过程else if相关的知识,希望对你有一定的参考价值。

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;

























以上是关于存储过程else if的主要内容,如果未能解决你的问题,请参考以下文章