Installation guide
7. mxODBC Cursor Objects
Switching between Search Patterns and Identifier Matching
Some ODBC drivers support adjusting the catalog method interface to interpret
the parameters as case-insensitive identifiers instead.
In mxODBC, this can be enabled using:
cursor.setcursoroption(SQL.ATTR_METADATA_ID, SQL.TRUE)
The setting persists on the cursor. It can be switched off again using:
cursor.setcursoroption(SQL.ATTR_METADATA_ID, SQL.FALSE)
which then causes the catalog methods to interpret the parameters as case-
sensitive search patterns again.
Whether this really helps with the problem described above depends on the
application.
Unicode
All catalog methods accept Unicode parameters, if the ODBC drivers provide the
necessary support for this.
Available Catalog Methods
Please note that the drivers may not implement all catalog methods that
mxODBC supports. In such a case, you will get a NotSupportedError or
AttributeError exception when trying to use a method that is not supported
by the ODBC driver.
The following catalog methods are supported by mxODBC:
.columns(qualifier=None, owner=None, table=None, column=None)
Query the database schema for information on table columns.
column allows restricting the results to a single column of a table.
Depending on the used query options, the result set will contain information
for only one table, the whole database or just a single column.
The catalog method generates a result set having the following schema:
Column Name Column Datatype Comment
TABLE_CAT VARCHAR(128) Always NULL.
TABLE_SCHEMA VARCHAR(128) The name of the schema containing
TABLE_NAME.
TABLE_NAME VARCHAR(128) not
NULL
The name of the table, or view, or alias, or
synonym.
115