mysql批量插入数据的存储过程

DROP PROCEDURE IF EXISTS my_insert;
CREATE PROCEDURE my_insert()
BEGIN
   DECLARE n int DEFAULT 1;
        loopname:LOOP
            
INSERT INTO order_today VALUES (n, n, n+100, '2021-04-27 12:21:58', n, '测试', '2021-04-27 12:22:12', '2021-04-27 12:22:15');
	
            SET n=n+1;
        IF n=100000 THEN
            LEAVE loopname;
        END IF;
        END LOOP loopname;
END;
CALL my_insert();

  

原文地址:https://www.cnblogs.com/torchstar/p/14708478.html