Oracle 游标

create or replace procedure pro_rkb
 as
   bz varchar2(50);
   je number(24,9);
   se number(24,3);

   cursor rkb is
   select rkdh ,fcol8 ,fcol11 from gy_cc_rkb where rklx='3' and (abs(fcol11) <abs(fcol8) or fcol11 is null);
   begin
    for rec in rkb loop
        bz:=rec.rkdh;
        je:=rec.fcol8;
        se:=rec.fcol11;
      update gy_cc_rkb t set t.fcol11=je , t.fcol8=se where t.rkdh = bz;
    end loop ;
   commit;
   end;

 

你可能感兴趣的:(oracle)