I have a query which should add random data to my table, but it doesn't work.
My query looks like this:
DECLARE @i INT;
SET @i = 0;
WHILE (@i < 25000) DO
BEGIN
INSERT INTO ak_class (class_name, class_description)
VALUES (CONCAT('Rose', RAND()*250000),
CONCAT('Roses are awesome', RAND()*250000));
SET @i = @i + 1;
END WHILE;
The error that is shown:
Error Code : 1064
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 'DECLARE @i INT' at line 1
Execution Time : 00:00:00:000
Transfer Time : 00:00:00:000
Total Time : 00:00:00:000
(0 row(s) affected)
Execution Time : 00:00:00:000
Transfer Time : 00:00:00:000
Total Time : 00:00:00:000
Error Code : 1064
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 (@i < 25000) DO
BEGIN
INSERT INTO ak_class (class_name, class_description)' at line 1
Execution Time : 00:00:00:000
Transfer Time : 00:00:00:000
Total Time : 00:00:00:000
(0 row(s) affected)
Execution Time : 00:00:00:000
Transfer Time : 00:00:00:000
Total Time : 00:00:00:000
Error Code : 1064
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
Execution Time : 00:00:00:000
Transfer Time : 00:00:00:000
Total Time : 00:00:00:000