Installation guide

mxODBC - Python ODBC Database Interface
Please note that mxODBC will try to use SQL type binding if possible, but
always falls back to Python type binding mode in case it cannot access the
needed type information from the ODBC driver or database. This even applies if
the binding mode is set to SQL type binding.
8.2.1 Adjusting the Type Binding Mode
As for many other attributes, mxODBC provide ways of defining the binding
method on a per connection or a per cursor basis.
Per Connection Type Binding Setting
If you run into problems when using mxODBC in SQL type binding mode, please
try to use Python type binding mode by configuring the connections to use Python
type binding mode:
connection.bindmethod = BIND_USING_PYTHONTYPE
After setting the connection.bindmethod all cursors created on the connection
will use the new bind method as default.
Per Cursor Type Binding Setting
If you want to adjust the bind method on a per-cursor basis, this is possible as
well, by setting the
cursor.bindmethod attribute.
cursor.bindmethod = BIND_USING_PYTHONTYPE
Doing so will not affect the connection the cursor was created on or any other
cursors created on the connection.
Per-Statement Binding Mode
With some database drivers, it is also possible to trigger the Python type binding
mode in a more fine-grained way on a per statement basis.
This is done by using
cursor.executedirect() method or the direct=1
parameters on other execution methods for running SQL statements against the
database.
mxODBC will then send the statements as-is to the database server and apply
Python type binding for the parameters.
142