SQlite question - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: SQlite question (/thread-26411.html) |
SQlite question - scratchmyhead - Apr-30-2020 When I run this piece of code, I get a syntax error. Could someone please pinpoint the error. conn = sqlite3.connect('roominventory.db') c = conn.cursor() c.fetchall() c.execute("""UPDATE rooms SET rate = nq1.get() WHERE type = 'NQ1' """) conn.commit() conn.close() RE: SQlite question - menator01 - Apr-30-2020 c.fetchall() should be below the c.execute() RE: SQlite question - buran - May-01-2020 (Apr-30-2020, 09:18 PM)scratchmyhead Wrote: Could someone please pinpoint the error.post the full traceback you get, in error tags. You run UPDATE statement, so c.fetchall() is not needed at all.
|