My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
Errors  
Exceptions raised by pyodbc
Updated Jul 28, 2011 by mkleehammer

Exceptions are raised when ODBC errors are detected. The exception classes specified in the DB API specification are used.

  • DatabaseError
  • DataError
  • OperationalError
  • IntegrityError
  • InternalError
  • ProgrammingError

When an error occurs, the type of exception raised is based on the SQLSTATE.

SQLSTATE Exception Class
0A000 NotSupportedError
22xxx DataError
23xxx 40002 IntegrityError
24xxx 25xxx 42xxx ProgrammingError
All Others DatabaseError

A primary key error (attempting to insert a value when the key already exists) will raise an IntegrityError.

Powered by Google Project Hosting