随笔 - 113  文章 - 0  评论 - 2  阅读 - 77958

存储过程实例

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

posted on   wenjingtester  阅读(197)  评论(0编辑  收藏  举报
< 2025年1月 >
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
2 3 4 5 6 7 8

点击右上角即可分享
微信分享提示