mysql批量插数据

drop procedure if exists prc_bill_xxx;
CREATE PROCEDURE prc_bill_xxx(l_cnt int)
BEGIN
   DECLARE x INT DEFAULT 0;
   DECLARE p varchar(256);

   WHILE x < l_cnt
   DO
      SET x = x + 1;
      SET p =300000000000001+x;

      INSERT INTO bill_xxx(ACCOUNT_LOG_ID,
                            BUSINESS_SERIAL_NO,
                            POS_ORDER_ID,
                            HAPPEN_TIME,
                            IN_AMOUNT,
                            OUT_AMOUNT)
         VALUES (
                   p,
                   "11111",
                   "22222",
                   "2021-07-10",
                   "111.11",
                   "2.22");
   END WHILE;
end

 

call prc_bill_xxx(10010);

 

posted @ 2021-10-19 17:27  kevinFeng  阅读(26)  评论(0编辑  收藏  举报