Python Forum
Problem with sqlite bindings
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with sqlite bindings
#1
I'm trying to update a sqlite database and I get the following error: sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 4 supplied. I don't understand where I'm going wrong. The code is below:

        conn = sqlite3.connect('financial.db')
        c = conn.cursor()
        c.execute("SELECT * FROM totals")
        records = c.fetchall()

        for record in records:


            if record[0] ==arrivale.get():


                t = ratee.get()
                c.execute("UPDATE totals SET rent = ? ", (t))
                c.fetchall()
Reply


Messages In This Thread
Problem with sqlite bindings - by scratchmyhead - May-18-2020, 03:17 AM
RE: Problem with sqlite bindings - by Larz60+ - May-18-2020, 03:27 AM
RE: Problem with sqlite bindings - by scratchmyhead - May-18-2020, 03:29 AM
RE: Problem with sqlite bindings - by Larz60+ - May-18-2020, 03:34 AM
RE: Problem with sqlite bindings - by scratchmyhead - May-18-2020, 03:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with inserting a string in to Sqlite db darktitan 3 4,527 Mar-03-2019, 06:30 PM
Last Post: stranac

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020