问答详情
源自:3-3 实例:给员工涨工资

各位大神帮忙看一下哪里有问题

set serveroutput on


declare
cursor c1 is select empno,ejob from emp;
peno emp.empno%type;
pjob emp.ejob%type;

begin
open c1;
loop
fetch c1 into peno,pjob;
exit WHEN c1%notfound;
if pjob='PRESIDENT' then update emp set sal=sal+100 where empno=peno;
elsif
if pjob='MANAGER' then update emp set sal=sal+200 where empno=peno;
else
update emp set sal=sal+200 where peno=empno;
end if;



end loop;

close c1;
end;
/

提问者:慕斯2513316 2019-08-22 22:52

个回答

  • 慕数据7234192
    2019-10-10 11:47:37

    多了个if

  • qq_魴肆d青春_0
    2019-08-26 15:05:04

    elsif后面多了个if

  • 华珠王健杰
    2019-08-25 16:42:22

    是emp.job,不是emp.ejob