1

I don't know what I'm doing wrong, but my database is not updating! This is what I'm doing, so simple:

conn = sqlite3.connect('tarefas.db')
c = conn.cursor()
c.execute("UPDATE tarefas SET concluido = 1")
conn.commit
conn.close()

I want to update all rows in this column. When I execute this query in a sqlite manager it works. Why python just can't?

2
  • 1
    I think that's supposed to be conn.commit() Commented Aug 6, 2013 at 17:32
  • Shame on me! I was looking for it the whole day. Thank you very much :) Commented Aug 6, 2013 at 17:36

1 Answer 1

4

You miss parentheses in the conn.commit call. Try this:

conn = sqlite3.connect('tarefas.db')
c = conn.cursor()
c.execute("UPDATE tarefas SET concluido = 1")
conn.commit()
conn.close()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.