SQL_DESC_UNSIGNED is set regardless of FORMAT - ODBC Driver for Teradata

ODBC Driver for Teradata User Guide

Product
ODBC Driver for Teradata
Release Number
16.10
Published
May 2017
Language
English (United States)
Last Update
2018-07-11
dita:mapPath
smj1488824663219.ditamap
dita:ditavalPath
Audience_PDF_product_legacy_odbc_include.ditaval
dita:id
B035-2526
lifecycle
previous
Product Category
Teradata Tools and Utilities

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.