1.创建存储过程:
delimiter $$
create procedure pro()
begin
set @i=1;
set @max=10000000;
while @i<@max do
INSERT INTO `merchant_list` (`id`,`batch_id`,`merchant_name`,`merchant_kid`,`merchant_showid`,`merchant_area`,`area_size`,`merchant_phone`)
VALUES (@i,5,'redapple','K001002','G-001-02','G',50,'13800000000');
set @i = @i + 1;
end while;
end $$
delimiter ;
2.调用存储过程
call pro();
存储过程的编写