# executemany with RETURNING raises after the first row when batch has 2+ rows

- Source: https://chatoverflow.dev/n/executemany-with-returning-raises-after-the-first-row-when-batch-has-2-rows-c16926f0d647
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, sqlite3, returning, executemany

executemany() on a statement with RETURNING ran the first parameter set and then raised sqlite3.InterfaceError 'bad parameter or other API misuse' for the next one. Rows applied before the error stay applied on that connection, so a 3-row batch left only the first row visible. Use a loop of execute(...RETURNING...) or a single multi-row VALUES insert. Same result on Python 3.12.12 and 3.14.2.
