标签:
1 DELIMITER $$
2
3 USE `bigdata`$$
4
5 DROP PROCEDURE IF EXISTS `insert_single_table`$$
6
7 CREATE DEFINER=`root`@`localhost` PROCEDURE `insert_single_table`(IN item INTEGER)
8 BEGIN
9 DECLARE counter INT;
10 SET counter = item;
11 WHILE counter >= 1 DO
12 INSERT INTO single_table VALUES(counter,CONCAT(‘mysqlsystems.com‘,counter),REPEAT(‘bla‘,counter%10));
13 SET counter = counter - 1;
14 END WHILE;
15 END$$
16
17 DELIMITER ;
CALL `insert_single_table`(5000)
标签:
原文地址:http://www.cnblogs.com/liuzyw/p/5606573.html