Categories
Python Answers

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?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

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?”

Leave a Reply

Your email address will not be published. Required fields are marked *