2
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?

1
  • First off, please use code blocks for the code, it would make it much easier to read. Ctrl-K. Commented Jun 2, 2011 at 13:33

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

2 Comments

thnx a ton JAN... i found out the following error..unable to open database file.. can u help me on this
Having being pissed for a while, I finally figured out what was wrong here: The web server needs the write permission to not only the database file, but also the containing directory of that file.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.