I am trying to create a prepared statement with the following pattern:
SELECT * FROM table WHERE key IN (value1, value2, value3, ..., valueN)
With pyodbc I tried the following syntax:
values = set(...)
cursor.execute('SELECT * FROM table WHERE key IN (?)', values)
Error:
The SQL contains <N> paramter markers, but 1 parameters were supplied
Do I have to generate a (?, ?, <...>, ?) for N ? myself or can I somehow insert a list/set into a single field of a prepared statement.