17.20 - 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
17.20
Published
June 2022
Language
English (United States)
Last Update
2022-06-21
dita:mapPath
uqj1639470627591.ditamap
dita:ditavalPath
nkw1500504256726.ditaval

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 metadata more closely.