MySQL command returns 0 results

I'm trying to add entries to my prestashop customization_field tables, one for each of our products. I wrote this command:

CREATE PROCEDURE test5 () BEGIN 
DECLARE a INT;
SET a = 1461;
WHILE (a <= 3185) DO insert into ps7h_customization_field values (DEFAULT, `a`, `1`, `0`, `0`, `0`, `0`);
SELECT a = a + 1;
END WHILE;
END;

1461 is the ID of the first product, 3185 is the ID of the last one. The structure of the table is:

id_customization_field int(10) AUTO_INCREMENT
id_product int(10)
type tinyint(1)
required tinyint(1)
is_module tinyint(1)
is_deleted tinyint(1)
tshirtecommerce tinyint(1)

I'd want a line for each product with product_id from 1461 to 3185, each with a new id_customization_field number. The command goes through, but it returns 0 results. What am I doing wrong?



Read more here: https://stackoverflow.com/questions/65716449/mysql-command-returns-0-results

Content Attribution

This content was originally published by vipmysqltest at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: