Installation guide
mxODBC - Python ODBC Database Interface
Some ODBC drivers do not support all of these methods or return unusable
data. As a result, you should verify correct operation for your target data sources
prior to relying on these methods.
Common Interface
All of the following catalog methods use the same interface: they do an implicit
call to
cursor.execute() and return their output in form of a list of rows which
that can be fetched with the
cursor.fetch*() methods in the usual way. The
number of available rows is available via
cursor.rowcount
16
. All catalog methods
support keywords and use the indicated default values for parameters which are
omitted in the call.
Please refer to the ODBC Documentation
for more detailed information about
parameters (if you pass
None as a value where a string would be expected, that
entry is converted to NULL before passing it to the underlying ODBC API).
Result Set Layouts
Note that the result set layouts described here may not apply to your data source.
Some databases do not provide all the information given here and thus generate
slightly different result sets. Expect column additions and even omissions and do
not rely on the column names used in the result set descriptions.
Search Pattern Parameters
The standard catalog method parameters qualifier, owner and table accept
SQL search patterns as input, e.g
. table='SYS%' would return all tables whose
name starts with SYS.
In some cases, the catalog functions provide additional search parameters such as
procedure or column. These parameters then also accept SQL search pattern
strings.
Case-sensitivity of Search Patterns
The search patterns given as parameters to these catalog methods are usually
interpreted in a case-sensitive way. This means that even if the database itself
behaves case-insensitive for identifiers, you may still not find what you're looking
for if you don't use the case which the database internally uses to store the
identifier.
As an example take the SAP DB: it stores all unquoted identifiers using uppercase
letters. Trying to fetch e.g. information about a table using a lowercase version of
the name will result in an empty result set. You can use
connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database
stores identifiers. See the ODBC Documentation
for details.
16
Note that this was changed in mxODBC 3.0. Previously the catalog methods used to
return the number of rows in the result set.
114