SQL_DESC_UNSIGNED is set regardless of FORMAT - ODBC Driver for Teradata - 16.20

ODBC Driver for Teradata® User Guide

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

The SQL_DESC_UNSIGNED ODBC descriptor record field is set to SQL_TRUE if the column type is unsigned or non-numeric. SQL_DESC_UNSIGNED is set to SQL_FALSE if the column type is signed.

An application can ask for the signed or unsigned characteristics of a column in a result set by using SQL_DESC_UNSIGNED in a call to SQLColAttribute or SQLGetDescField. An application can ask for the signed or unsigned characteristics of a parameter marker associated with a prepared SQL statement by using SQL_DESC_UNSIGNED in a call to SQLGetDescField.

When extended statement information is not available, ODBC Driver for Teradata determines the signed or unsigned characteristics by looking at the database type and the display format string.

If the format string includes a sign character, then the column or parameter is classified as signed and SQL_DESC_UNSIGNED is set to SQL_FALSE. If the format string does not include a sign character, then SQL_DESC_UNSIGNED is set to SQL_TRUE. For example, if the column type is INTEGER and the format ‘ZZZ9’, then SQL_DESC_UNSIGNED is SQL_TRUE, but if the format is ‘+ZZZ9’, then the SQL_DESC_UNSIGNED is SQL_FALSE.

In ODBC Driver for Teradata with extended statement information available, the driver as default obtains the signed or unsigned characteristics from the extended statement meta data provided by the database. For example, if the column type is INTEGER, then it is always signed and SQL_DESC_UNSIGNED is SQL_FALSE, regardless of any format string.

The behavior in ODBC Driver for Teradata with extended statement information available is considered more correct because it reflects the database meta data more closely.