Installation guide
8. Data Types supported by mxODBC
print cursor.fetchall()
More information about the connection and cursor attribute .paramstyle is
available in section 6.8 Connection Object Attributesand 7.7 Cursor Object
Attributes.
8.2 mxODBC Input Binding Modes
When passing parameters to the .execute*() methods of a cursor, mxODBC
has to apply type conversions to the parameters in order to send them to the
database in an appropriate form. This process is called binding a variable.
mxODBC implements two different input variable binding modes depending on
what the ODBC driver can deliver. The currently used binding mode can be
determined by looking at the
cursor.bindmethod (which is inherited from the
connection.bindmethod at cursor creation time).
Binding Mode
Value of .bindmethod
Comments
BIND_USING_SQLTYPE The database is asked for the
appropriate data type and mxODBC
tries to convert the input variable
into that type.
This is the preferred binding mode
since it allows to choose the right
conversion before passing the data
to the ODBC driver.
SQL type binding
Python type
binding
BIND_USING_PYTHONTYPE mxODBC looks at the type of the
input variable and passes its value
to the database directly; conversion
is done by the ODBC
driver/manager as necessary.
The default depends on the capabilities of the ODBC driver being used on the
connection. mxODBC will always try to use the SQL type binding mode
(
BIND_USING_SQLTYPE), since this offers more flexibility than Python type
binding.
141