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?
phihag
289k75 gold badges475 silver badges489 bronze badges
-
First off, please use code blocks for the code, it would make it much easier to read. Ctrl-K.Jan– Jan2011年06月02日 13:33:22 +00:00Commented Jun 2, 2011 at 13:33
1 Answer 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
answered Jun 2, 2011 at 13:41
Jan
4,5366 gold badges26 silver badges21 bronze badges
Sign up to request clarification or add additional context in comments.
2 Comments
lsharma
thnx a ton JAN... i found out the following error..unable to open database file.. can u help me on this
lsharma
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.
default