Installation guide
mxODBC - Python ODBC Database Interface
Supported Data Types and are available through the SQL singleton defined at
module level.
Please see section 5.7.2 Result Set Introspection for more information on this
attribute and how to use it.
.encoding
Read/write attribute which defines the encoding to use for converting Unicode
to 8-bit strings and vice-versa. If set to
None (default), Python's default
encoding will be used, otherwise it has to be a string providing a valid
encoding name, e.g.
'latin-1' or 'utf-8'.
The setting is inherited from the
connection.encoding at cursor creation
time, but can be adjust independently from the connection after its creation.
All cursor related APIs such
cursor.execute*() and cursor.fetch*()
methods use the
cursor.encoding for Unicode conversions.
.messages
This is a Python list object to which the standard mxODBC error handler
appends tuples
(exception class, exception value) for all messages
which the interfaces receives from the underlying ODBC driver or manager for
this cursor. See section 10. Error Handlers
for details.
The list is cleared by all cursor methods calls (prior to executing the call)
except for the
.fetch*() calls to avoid excessive memory usage and can also
be cleared explicitly by executing
del cursor.messages[:].
An application can use the information in this list to verify correct operation of
the method calls. This is particularly useful if the ODBC driver or database
splits the error information across multiple error messages. In such a case,
only one of the messages will be used to raise the exception by mxODBC
(usually the top-most), but this message may not provide enough information
to track down the problem.
.paramcount
This read-only attribute specifies the number of parameters in the current
prepared command.
The attribute is
-1 in case this information is not available.
.paramstyle
Sets the default parameter binding style of the cursor. The value is initially set
to the value of
connection.paramstyle of the creating connection. The value
takes affect on the next call to a
cursor.execute*() method.
The attribute can be set or queried and takes the following string values
(following the
paramstyle module global as defined in the DB-API):
'qmark' (default)
This is the default ODBC parameter binding style and also used as native
database binding style by MS SQL Server and IBM DB2.
Parameters in SQL statements used on
cursor.execute*() methods are
marked with the question mark letter (
'?') and the variables are bound to
136