Installation guide

5. mxODBC Overview
Introspection via cursor.execute()
In mxODBC this can be done right after executing a SQL statement using one of
the
cursor.execute*() methods by looking at the cursor.description
attribute.
Introspection via cursor.prepare()
Alternatively, you can use the cursor.prepare() method to just prepare
execution of a SQL statement - without actually executing it. This may be desirable
in case the result set is not immediately needed or the query would require a long
time to execute.
The cursor.description attribute
This cursor attribute provides access to a sequence of tuples, each describing the
result set column at that position:
(name, type_code, display_size,
internal_size, precision, scale, null_ok).
If no information is available the
cursor.description is set to None.
The column tuple entries have the following meanings (index given in square
brackets):
name [0]
Name of the column as returned by the database.
type_code [1]
In mxODBC, this is the SQL type integer describing the database data type of
the result set column. These are described in the section 8 Supported Data
Types and are available through the SQL singleton defined at subpackage
module level for comparisons.
display_size [2]
mxODBC will always return None for this field. For database tables, this
information can be determined by using the
cursor.getcolattribute(position, SQL.DESC_DISPLAY_SIZE) method,
if needed.
internal_size [3]
mxODBC will always return None for this field. For database tables, this
information can be determined by using the
cursor.getcolattribute(position, SQL.DESC_OCTET_LENGTH) method,
if needed.
precision [4]
Precision of numeric columns.
scale [5]
Scale of numeric columns.
77