I have written some code I like to use with several databases. At the
moment sqlite and postgres. It looks like with progres I can use:
  cursor.execute('COMMIT;')
but that with sqlite I need to use:
    conn.commit()

Is this true, or am I doing something wrong?

When I use
  cursor.execute('COMMIT;')
with sqlite, I get:
    sqlite3.OperationalError: cannot commit - no transaction is active
While
    conn.commit()
does what it should do.

Before I do my statements I use:
  cursor.execute(BEGIN TRANSACTION;')

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to