数据库
首页 > 数据库> > mysql批量插数据

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_record_error(10010);

 

标签:cnt,bill,批量,prc,xxx,WHILE,SET,mysql,数据
来源: https://www.cnblogs.com/KevinFeng/p/15425686.html