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
默認(rèn)情況下,oracle數(shù)據(jù)庫(kù)允許在同一會(huì)話下,只能打開300個(gè)光標(biāo)(可以查看oracle初始化參數(shù)得到這個(gè)值)。它的意思是指open光標(biāo)之后,打開到一定數(shù)量就不可以在打開光標(biāo)了。