慕斯2513316
2019-08-22 22:52
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;
/
多了个if
elsif后面多了个if
是emp.job,不是emp.ejob
Oracle数据库开发必备利器之PL/SQL基础
75048 学习 · 208 问题
相似问题