通过数据库存储过程批量插入mysql数据库,id为uuid
DROP PROCEDURE IF EXISTS my_insert;
CREATE PROCEDURE my_insert()
BEGIN
DECLARE n int DEFAULT 0;
loopname:LOOP
INSERT INTO `patient_info` (`id`, `brxm00`, `brlxdh`, `test`, `certype`, `certid`, `birth`) VALUES (CONCAT(replace(uuid(), '-', ''))
, '860103', '103', '2021-04-27 12:21:58', '3', '测试', '2021-04-27 12:22:12');
SET n=n+1;
IF n=10000 THEN
LEAVE loopname;
END IF;
END LOOP loopname;
END;
CALL my_insert();