1.创建一个test_batchInsert的存储过程
delimiter $$$
create procedure test_batchInsert(in j int)
begin
declare i int default 0;
set i=0;
start transaction;
while i<j do
INSERT INTO table_name (id,name,create_time) VALUES (REPLACE(uuid(),"-",""),CONCAT("名字",i),current_timestamp())
set i=i+1;
end while;
commit;
end
$$$
delimiter;
2.运行存储过程
call test_batchInsert(20);
3.存在那些存储过程
drop procedure test_batchInsert