15.10 - SQL Descriptor Fields - ODBC Driver for Teradata

ODBC Driver for Teradata User Guide

ODBC Driver for Teradata
User Guide

The following descriptor fields are exposed by ODBC Driver for Teradata:

  • SQL_DESC_TD_ACTIVITY_TYPE is an SQLINTEGER that indicates the type of SQL statement that was executed.
  • SQL_DESC_TD_COST_ESTIMATE is an SQLINTEGER with a cost estimate for running the SQL statement. The value returned is the time estimate in seconds.
  • SQL_DESC_TD_FORMAT is a character string which is the Teradata FORMAT column.
  • SQL_DESC_TD_ACTUAL_NAME is a character string containing the column name associated with the result column.
  • SQL_DESC_TD_CHARACTER_SET is an SQLINTEGER that contains the character set of a given column. Values are:
  • If both the Extended Statement Information and LOB support options are disabled, the ODBC driver is unable to determine the server character set, resulting in the return value SQL_TD_CS_UNDEFINED.

  • SQL_DESC_TD_EXPORT_WIDTH is an SQLINTEGER that contains the database export width for character columns, while SQL_DESC_TD_EXPORT_WIDTH_ADJ is an SQLINTEGER that contains the database export width adjustment for character columns.
  • These fields are only valid if the column character set is different from SQL_TD_CS_UNDEFINED; otherwise they have the value -1, which indicates an undefined value.

    The fields can be used to calculate the number of bytes exported by Teradata Database for a given character column. The formula is:

    <Number of bytes > = <export width * N > + <export width adjustment>

    where N is the number of characters in the column.

  • SQL_DESC_TD_EXPORT_BYTES is an SQLINTEGER that contains the number of bytes the database provides for a character column.
  • SQL_DESC_TD_ODBC_TYPE is an SQLSMALLINT that contains the Teradata ODBC‑specific SQL data type code. If multiple database types have the same standard ODBC SQL type, then the Teradata ODBC‑specific SQL data type code can be used to distinguish between the types. For Example, see “Number Data Types” on page 138.