批量数据订正

begin
   for x in ( select order_id, rownum r  from billing_order where status != 'closed' and pc2_type = '1' )
   loop
        update billing_order  set pc2_type = '4',gmt_modified = sysdate
         where order_id = x.order_id;
        if ( mod(x.r,1000) = 0 ) then
           commit;
        end if;
   end loop;
   commit;
end;
 

你可能感兴趣的:(数据)