loop
fetch cs into pempno,psal;
exit when salTotal>50000 or cs%notfound;
if (salTotal + psal*0.1)>50000 then exit;
else
update emp set sal =sal *1.1 where empno=pempno;
countEmp :=countEmp+1;
salTotal :=salTotal + psal*0.1;
end if;
end loop;
fetch cs into pempno,psal;
exit when salTotal>50000 or cs%notfound;
if (salTotal + psal*0.1)>50000 then exit;
else
update emp set sal =sal *1.1 where empno=pempno;
countEmp :=countEmp+1;
salTotal :=salTotal + psal*0.1;
end if;
end loop;
2020-05-18
最新回答 / 慕虎9444539
默认情况下,oracle数据库允许在同一会话下,只能打开300个光标(可以查看oracle初始化参数得到这个值)。它的意思是指open光标之后,打开到一定数量就不可以在打开光标了。
2020-05-03