Created
January 18, 2016 07:46
-
-
Save savanovich/ba9eb904821df5306e59 to your computer and use it in GitHub Desktop.
Fill table with test data. Mysql procedure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $ | |
CREATE PROCEDURE fill_test_table(x1 INT, x2 INT) | |
BEGIN | |
SET @x = x1; | |
REPEAT | |
INSERT INTO test_table SET id=@x, insert_time=UNIX_TIMESTAMP(); | |
SET @x = @x + 1; | |
UNTIL @x > x2 END REPEAT; | |
END$ | |
DELIMITER ; | |
CALL fill_test_table(1, 100); -- insert 100 rows |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment