The experiment was supposed to take about 5 minutes so wasn't really expecting this ^^
Anyway, I installed mysql server on my desktop, tried to create a procedure that bombs a table with rows.
Code: Select all
CREATE PROCEDURE dowhile()
BEGIN
SET @v1 = 5000000;
WHILE v1 > 0 DO
INSERT INTO test values(10000, 'thisisatest', 'thisisatest', 'thisisatest', 'thisisatest', 'thisisatest');
SET v1 = v1 - 1;
END WHILE;
END;
I receive this though
Code: Select all
mysql> BEGIN
-> WHILE 1 > 0 DO
-> INSERT INTO test values(10000, 'thisisatest', 'thisisatest', 'thisisatest', 'thisisatest', 'thisisatest');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHILE 1 > 0 DO
INSERT INTO test values(10000, 'thisisatest', 'thisisatest', ' at line 2
mysql> END WHILE;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END WHILE' at line 1
mysql> END;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END' at line 1
mysql>
Code: Select all
http://dev.mysql.com/doc/refman/5.5/en/while-statement.html
Can anyone enlighten me?