--- SQL ---
INSERT INTO usuarios
(active, email, age, name)
VALUES (%s, %s, %s, %s)
ON DUPLICATE KEY UPDATE
name = %s
--- PARAMS ---
(True, 'joao@email.com', 29, 'JoaoValues', 'NAME_UPDATE')
(True, 'alex@email.com', 29, 'AlexValues', 'NAME_UPDATE')
File "c:\Projetos\Python\simple_sql_builder\.venv\Lib\site-packages\mysql\connector\cursor.py", line 519, in executemany
stmt = self._batch_insert(operation, seq_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Projetos\Python\simple_sql_builder\.venv\Lib\site-packages\mysql\connector\cursor.py", line 465, in _batch_insert
raise ProgrammingError(
mysql.connector.errors.ProgrammingError: Not all parameters were used in the SQL statement
I'm getting the error below using
ON DUPLICATE KEY UPDATEwithexecutemany().The same doesn't happen using
execute()with 1 param at a time.Error