SQL_DESC_BASE_COLUMN_NAME When There Is An Alias - ODBC Driver for Teradata

ODBC Driver for Teradata® User Guide

Product
ODBC Driver for Teradata
Release Number
16.20
Published
August 2020
Language
English (United States)
Last Update
2020-08-25
dita:mapPath
fxv1527114222338.ditamap
dita:ditavalPath
Audience_PDF_product_legacy_odbc_include.ditaval
dita:id
B035-2526
lifecycle
previous
Product Category
Teradata Tools and Utilities

When extended statement information is not available, the value of the SQL_DESC_BASE_COLUMN_NAME descriptor field will always be the same as the value of the SQL_DESC_NAME descriptor field. The value is the alias, if there is one; otherwise, the column name, if there is one, or the empty string, if there is no alias or column name.

When extended statement information is available, Teradata Database returns the alias and base column name as separate meta data items and ODBC is therefore able to distinguish between and SQL_DESC_NAME. The values will differ if there is an alias.

Consider, for example:

SELECT k AS kalias FROM SomeTable;

With extended statement information available, ODBC Driver for Teradata will return “k” for SQL_DESC_BASE_COLUMN_NAME and “kalias” for SQL_DESC_NAME.