This code works:
sql = \"\"\"TRUNCATE TABLE product_groups;\"\"\"
cursor.execute(sql)
sql = \"\"\"INSERT INTO product_groups (origin, type, name, brand, concent
This statement:
cursor.execute(sql, multi=True)
creates an iterator over the results. It looks like it's lazy (i.e., it executes SQL statements only as needed). You're never asking for the results for the second statement, so it is only executing the first one. Try:
for _ in cursor.execute(sql, multi=True): pass
In general it's better to just use separate execute()
calls.