lsharma
lsharma

Reputation: 121

python sqlite3 not working

try:
    c = db.cursor()
    c.execute("insert or replace into registrations values " +
              "(?, ?, datetime('now'))", (user, identity))
    print '\t<update>true</update>'
except Exception,inst:
    print inst.args

insert create table not working. How do I fetch the exception details?

Upvotes: 2

Views: 624

Answers (1)

Jan
Jan

Reputation: 4496

If you read this Python PEP, it should describe the exception classes for the Sqlite Python module.

Have you tried something like this:

try:
  db_cursor.execute('some hopefully valid SQL;')
except sqlite3.Error, msg:
  print msg

Upvotes: 1

Related Questions