Skip to content Skip to sidebar Skip to footer

Programmingerror: Incorrect Number Of Bindings Supplied. The Current Statement Uses 1, And There Are 40 Supplied

I have a user input where I want to enter a userID and retrieve the songID's that are asscociated with that user. I'm having trouble with this because of errors around the cursor.

Solution 1:

Should already be answered here: sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 74 supplied

The short of it though, is the second parameter in your execute call is expected to be a tuple instead of just the value, so wrap randomVariable as follows:

cursor.execute(MusicData,(randomVariable,))

Hope this helps!

Why it thinks that you supplied 40 parameters is because it is iterating over your input string thinking each character is a parameter you meant to fill in.

Post a Comment for "Programmingerror: Incorrect Number Of Bindings Supplied. The Current Statement Uses 1, And There Are 40 Supplied"