SQL_DESC_BASE_COLUMN_NAME when there is an alias

ODBC Driver for Teradata® User Guide

brand
Teradata Tools and Utilities
prodname
ODBC Driver for Teradata
vrm_release
16.20
category
User Guide
featnum
B035-2526-108K

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, the 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.