自从那天灵感突现,搜了下MySQL存储过程的实现,我就再也不会为造测试数据这种事情烦恼了,存储过程用起来简直太方便了。

DROP PROCEDURE IF EXISTS insert2pay;
DELIMITER $
create procedure insert2pay()
begin
    declare i int default 1501;
    while i <= 6000 do
        insert into anypay.pay (merchant_id, merchant_no, merchant_channel_id, merchant_name, order_no, outer_no, tracking_number) values (1, '123', 1, 'lktz', concat('odn190611', i), concat('otn190611', i), '1231231235');
        set i = i + 1;
    end while;
end $
call insert2pay();

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-18
  • 2021-04-29
  • 2022-01-07
  • 2021-12-16
  • 2021-08-14
相关资源
相似解决方案