Sometimes, we want to fix sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 8 supplied with Python SQLite parameter substitution.
In this article, we’ll look at how to fix sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 8 supplied with Python SQLite parameter substitution.
How to fix sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 8 supplied with Python SQLite parameter substitution?
To fix sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 8 supplied with Python SQLite parameter substitution, we’ve to make sure that the 2nd argument of execute
is a list.
For instance, we write
cursor.execute("SELECT weight FROM Equipment WHERE name = ?", [item])
to call cursor.execute
with a SQL string and a list of items to replace the ?
placeholders with.
Conclusion
To fix sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 8 supplied with Python SQLite parameter substitution, we’ve to make sure that the 2nd argument of execute
is a list.
One reply on “How to fix sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 8 supplied with Python SQLite parameter substitution?”
it really helpful, thanks