comm が null の場合、comm
値をに更新する必要がありますsalary
が1100
、更新されていません。
私のデータは次のとおりです。
sal comm
9000 800
2975 800
3000 800
1100
3000 800
私のコードは次のとおりです。
declare
cursor c3 is select sal,comm,ename from emp where deptno=20
for update of comm;
begin
for c in c3
loop
if c.comm is null
then
update emp set comm=(select c.sal from emp e where e.comm=c.comm )
where current of c3;
end if;
end loop;
end;
これについて意見をください。