Categories
Python Answers

How to fix sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 74 supplied with Python?

Spread the love

Sometimes, we want to fix sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 74 supplied with Python.

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 74 supplied with Python.

How to fix sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 74 supplied with Python?

To fix sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 74 supplied with Pythonm we should make sure we call execute with a tuple.

For instance, we write

cursor.execute('INSERT INTO images VALUES(?)', (img,))

to call execute with a SQL string and a tuple.

We make the 2nd argument a tuple by putting a comma after img since it only has one item.

Conclusion

To fix sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 74 supplied with Pythonm we should make sure we call execute with a tuple.

By John Au-Yeung

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

Leave a Reply

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