Page 1 of 1

Need help in FOR UPDATE & WHERE CURRENT OF clause

Posted: Tue May 19, 2009 5:39 am
by ali560045
i have a PL/SQL Block that updates a table f by using the concept of "FOR UPDATE" & "WHERE CURRENT OF" Clause.Below is the code

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;
 
 
Contents of table f

Code: Select all

 
A     B
--   ---
 
5    Five 
6    Six 
7    Seven
8    Eight
9    Nine
 
The above PL/SQL BLOCK is giving me the NULL Value for A=7 and A=8.Please help me