Download mxODBC - Python ODBC Database Interface

Transcript
mxODBC - Python ODBC Database Interface
.getcolattributes(position, info_id)
Get information about the result set column position. The column index
must be given as 0-based integer, i.e. the first result setup column has the
index 0.
info_id must be an integer and identifies the requested field information.
Suitable values are available through the SQL object (see the Constants section
10.5 for details).
The method returns a tuple (integer, string) giving an integer decoding
(in native integer byte order) of the first bytes of the API's result as well as the
raw buffer data as string. It is up to the caller to decode the data (e.g. using the
struct module).
This API gives you a wide range of information about the result set column. See
the ODBC SQLColAttribute API Documentation for more information.
Some of these values are also available through the cursor.description
attribute.
This is a list of useful info ids:
Option
Comment
SQL.DESC_AUTO_UNIQUE_VALUE Check whether the result set column refers to an
auto-increment column of the table.
The check only returns valid values for numeric
columns that can be defined as auto-increment
column in the database.
Returns an integer value:
SQL.TRUE - column is auto-increment
SQL.FALSE - column is not an auto-increment
column or not numeric
SQL.DESC_BASE_COLUMN_NAME
Base column name of the result set column. If the
base column name cannot be determined, e.g. for
expressions, an empty string is returned.
Returns a string..
SQL.DESC_BASE_TABLE_NAME
Base table name of the result set column. If the base
table name cannot be determined, e.g. for
expressions, an empty string is returned.
Returns a string..
SQL.DESC_DISPLAY_SIZE
Returns the maximum number of characters
needed to display the column data.
Returns an integer.
SQL.DESC_LENGTH
76
Returns the maximum length of the column data in