I have to insert some rows for each product with a loop but i receive a syntax error. i dont know why.
This is my query:
CREATE PROCEDURE insertURL()
BEGIN
DECLARE i INT DEFAULT 0;
WHILE (i <= 120) DO
INSERT INTO product_images (alt, url, `index`, product_id)
VALUES ('productImage', 'image/products/producte.png', 1, i);
VALUES ('productImage', 'image/products/producte.png', 0, i);
VALUES ('productImage', 'image/products/producte.png', 0, i);
VALUES ('productImage', 'image/products/producte.png', 0, i);
SET i = i + 1;
END WHILE;
END
And i receive this error:
SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near " at line 4
INSERTsyntax: `INSERT INTO t (...) VALUES (1,2,3),(11,22,33), ... ,(66,55,44);