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數(shù)據(jù)庫允許在同一會話下,只能打開300個光標(可以查看oracle初始化參數(shù)得到這個值)。它的意思是指open光標之后,打開到一定數(shù)量就不可以在打開光標了。
2020-05-03