Column Size, Decimal Digits, Transfer Octet Length, and Display Size
The values returned by these functions for the column or parameter size
correspond to
Similarly, the values for transfer octet length do not come from
SQL_DESC_LENGTH. They come from the SQL_DESC_OCTET_LENGTH of a field of a descriptor for all
character types, all binary types, all datetime and interval types, and the
SQL_BIT type. There is no descriptor field that holds this information for other
types.
The display size value for all data types corresponds to the value in a single
descriptor field, SQL_DESC_DISPLAY_SIZE.
Descriptor fields describe the characteristics of a result set. Descriptor
fields do not contain valid values about data before statement execution. The
values for column size, decimal digits, and display size returned by SQLColumns, SQLProcedureColumns, and SQLGetTypeInfo, on the other hand, return characteristics of database objects, such as table
columns and data types, that exist in the data source
For more information about these descriptor fields, see SQLSetDescField.
SQLDescribeCol returns the column size and decimal digits of the columns it describes.
SQLDescribeParam returns the parameter size and decimal digits of the parameters it describes.
Note that SQLBindParameter sets the parameter size and decimal digits for a parameter in an SQL
statement.
The catalog functions SQLColumns, SQLProcedureColumns, and SQLGetTypeInfo return attributes for a column in a table, result set, or a procedure
parameter and the catalog attributes of the data types in the data source. SQLColumns returns the column size, decimal digits , and length of a column in specified
tables (such as the base table, view, or a system table). SQLProcedureColumns returns the column size, decimal digits, and length of a column in a
procedure. SQLGetTypeInfo returns the maximum column size and the minimum and maximum decimal digits of
an SQL data type on a data source.