Home » Oracle » PLSQL block for traversal cursor

PLSQL block for traversal cursor

Declare

Cursor cur_quick_info is

Select * from ewallet.t_quick_pay_info where status='S'and pay_channel='01001906' and outer_merchant_id='1217015601'and quick_pay_id='201501010010KJ072895'; WeChat 010 old merchant signing quick information



V_row_count integer: =0; - count

V_total integer: =0;

V_quick_temp cur_quick_info%rowtype;

V_pre_value VARCHAR2 (1000) - the value update before the quick signing information "
"




Begin



for, v_quick_temp, in, cur_quick_info

loop

v_pre_value:='{"accountId": "'|| ||' v_quick_temp.account_id", "status": "'|| ||' v_quick_temp.status", "quickPaySn": "'

v_quick_temp.quick_pay_sn || || '"," quickPayId ":" v_quick_temp.quick_pay_id' || || '"," payChannel "," v_quick_temp.pay_channel
"||
|| '"," the merchant
outerM
updaterchantId: 'v_quick_temp.outer_merchant_id' || || "," outerSignSn "," v_quick_temp.outer_sign_sn "}'' || || ';



-- changes the quick contract to go 04 new channels and new e ewallet.t_quick_pay_info set pay_channel='02401906', outer_merchant_id='1301414501', modify_time=sysdate where


quick_pay_id=v_quick_temp.quick_pay_id;

-- insert a change record,

Insert, into, ewallet.t_quick_pay_info_log (ID, quick_pay_id, status, create_ip, pre_value, description, create_time,
)
Values (ewallet.T_QUICK_PAY_LOG_SEQ.nextval, v_quick_temp.quick_pay_id, v_quick_temp.status, '', ''010', '024', 'new interface', 'v_pre_value', 'sysdate'), '




v_row_count:=v_row_count+1;

v_total:=v_total+1;



if v_row_count mod 10000 = 0 then - 1W per commit

commit;

v_row_count:=0;

end if;





If v_total mod 100000 =0 then

-- dbms_lock.sleep (3) - records sleep 3 seconds per 10W,

V_total:=0;

End if;



end loop;



commit; --commit less than 1W transaction





End;

/

Latest