Code: Select all
declare
v_a f.a%type;
v_b f.b%type;
cursor cur_r is
select a,b from f where length(b) = 5 for update;
Begin
for record in cur_r
LOOP
update f set a=v_a*v_a where current of cur_r;
End loop;
end;
Code: Select all
A B
-- ---
5 Five
6 Six
7 Seven
8 Eight
9 Nine