当前位置 : 主页 > 手机开发 > ROM >

存储过程实例

来源:互联网 收集:自由互联 发布时间:2021-06-10
BEGIN DECLARE orderPayId INT; DECLARE orderId INT; DECLARE cur CURSOR FOR SELECT order_pay_id,order_id FROM tt_mss_pay_info WHERE id = 114659; OPEN CUR; read_loop: LOOP SET DONE := DONE + 1; IF DONE order_id_NUM THEN LEAVE read_loop; ELSE F

BEGIN

DECLARE orderPayId INT;
DECLARE orderId INT;
DECLARE cur CURSOR FOR SELECT order_pay_id,order_id FROM tt_mss_pay_info WHERE id >= 114659;

OPEN CUR;

read_loop: LOOP SET DONE := DONE + 1; IF DONE > order_id_NUM THEN LEAVE read_loop; ELSE FETCH cur INTO orderPayId,orderId; INSERT INTO `msssit`.`tt_mss_sale_order_send_task` ( `order_pay_id`, `order_id`, `version`, `server_id`, `send_tm`, `send_status`, `send_num`, `send_remark`, `create_tm`, `create_emp`, `update_tm`, `update_emp` ) VALUES ( orderPayId, orderId, ‘1‘, ‘10.202.38.1308080‘, SYSDATE(), ‘3‘, ‘1‘, ‘‘, SYSDATE(), ‘system‘, SYSDATE(), ‘system‘ ); END LOOP; commit;END

网友评论