Python Forum

Full Version: SQlite question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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()
c.fetchall() should be below the c.execute()
(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.