Insert a large amount of data into a table in the MySQL database: USE method: DELIMITER $ USE 'macross _ wudi '$ DROPPROCEDUREIFEXISTS 'test'
Insert a large amount of data into a table in the MySQL database: USE method: DELIMITER $ USE 'macross _ wudi '$ drop procedure if exists 'test'
Insert a large amount of data into a table in the MySQL database:
Usage:
DELIMITER $
USE 'macross _ wudi '$
Drop procedure if exists 'test' $
Create procedure 'test '()
BEGIN
DECLARE I INT DEFAULT 333;
DECLARE j int default 333;
WHILE (I <= 800000) DO
Replace into fs_mobile_ms_dat VALUES (I, 669, j, 'Guest ', 'running', '2017-10-10', '2017-10-11 ', '0', '0 ');
SET I = I + 1;
SET j = j + 1;
End while;
END $
DELIMITER;
CALL test ();
Reference Methods:
Drop procedure test;
DELIMITER;
Create procedure test ()
BEGIN
DECLARE I INT DEFAULT 1;
DECLARE j int default 1;
DECLARE k int default 1;
DECLARE s int default 1;
WHILE I <= 500000
DO
WHILE j <= 50
DO
Insert into fs_ms_task values (k, I, j, 'Guest ', 'running', '2017-08-24', '2017-08-24 ', '0', '0 ');
SET j = j + 1;
SET k = k + 1;
End while;
SET I = I + 1;
SET j = 1;
End while;
END;
CALL test ();
,