16.17 Attributes that can be specified in SQLGetDescField, SQLGetDescFieldW, SQLSetDescField, and SQLSetDescFieldW
The following table lists and describes the attributes that can be specified in SQLGetDescField, SQLGetDescFieldW, SQLSetDescField, and SQLSetDescFieldW.
No. |
Attribute |
Description (convention) |
Support status |
Data type |
---|---|---|---|---|
1 |
SQL_DESC_ALLOC_TYPE |
Whether the descriptor was allocated automatically or explicitly.
|
Supports the following values:
|
SQLSMALLINT |
2 |
SQL_DESC_ARRAY_SIZE |
|
Supports the following value:
|
SQLULEN |
3 |
SQL_DESC_ARRAY_STATUS_PTR |
|
Supports the following value:
|
SQLUSMALLINT * |
4 |
SQL_DESC_BIND_OFFSET_PTR |
Binding offset specified by the application program. This value is added to the delay field during a fetch operation.
|
Supports the following value:
|
SQLLEN * |
5 |
SQL_DESC_BIND_TYPE |
Binding orientation for columns or parameters.
|
Supports the following value:
|
SQLINTEGER |
6 |
SQL_DESC_COUNT |
Highest number of the record that stores data. The permitted value is 1 or greater. |
Supports the following values:
|
SQLSMALLINT |
7 |
SQL_DESC_ROWS_PROCESSED_PTR |
|
Supports the following value:
|
SQLULEN * |
No. |
Attribute |
Description (convention) |
Support status |
Data type |
---|---|---|---|---|
1 |
SQL_DESC_AUTO_UNIQUE_VALUE |
Whether columns are incremented automatically.
|
Supports the following value:
|
SQLINTEGER |
2 |
SQL_DESC_BASE_COLUMN_NAME |
Base column name for the result set column. |
Supports the following values:
|
|
3 |
SQL_DESC_BASE_TABLE_NAME |
Base table name for the result set column. |
Supports the following value:
|
|
4 |
SQL_DESC_CASE_SENSITIVE |
Whether the column or parameter is treated as being case-sensitive during collations or comparisons.
|
Supports the following values:
|
SQLINTEGER |
5 |
SQL_DESC_CATALOG_NAME |
Catalog name for the base table that contains the column. |
Supports the following value:
|
|
6 |
SQL_DESC_CONCISE_TYPE |
Concise data type for all data types. |
Supports the following value:
|
SQLSMALLINT |
7 |
SQL_DESC_DATA_PTR |
Pointer to the buffer that stores the parameter value (APD) or column value (ARD). |
Supports the following values:
|
SQLPOINTER |
8 |
SQL_DESC_DATETIME_INTERVAL_CODE |
Subcode for the specific datetime or interval data type when the SQL_DESC_TYPE field value is SQL_DATETIME or SQL_INTERVAL. Otherwise, this field is 0. |
Supports the following values:
|
SQLSMALLINT |
9 |
SQL_DESC_DATETIME_INTERVAL_PRECISION |
Interval leading precision when the SQL_DESC_TYPE field is SQL_INTERVAL. Otherwise, this field is 0. |
Supports the following value:
|
SQLINTEGER |
10 |
SQL_DESC_DISPLAY_SIZE |
Maximum number of characters required to display the data from the column. |
Supports the following values according to the data type:
|
SQLLEN |
11 |
SQL_DESC_FIXED_PREC_SCALE |
Whether the column is an exact numeric column.
|
Supports the following value:
|
SQLSMALLINT |
12 |
SQL_DESC_INDICATOR_PTR |
Whether the column or parameter value is NULL. |
Supports the following values:
|
SQLLEN * |
13 |
SQL_DESC_LABEL |
Column label or title. |
Supports the following values:
|
|
14 |
SQL_DESC_LENGTH |
Maximum or actual length of a character string or a binary data type. |
Supports the following value:
|
SQLULEN |
15 |
SQL_DESC_LITERAL_PREFIX |
The character or characters that the driver recognizes as a prefix for a data-type literal. |
Supports the following value:
|
|
16 |
SQL_DESC_LITERAL_SUFFIX |
The character or characters that the driver recognizes as a suffix for a data-type literal. |
Supports the following value:
|
|
17 |
SQL_DESC_LOCAL_TYPE_NAME |
Localized name for the data type that differs from the regular name of the data type. |
Supports the following value:
|
|
18 |
SQL_DESC_NAME |
Column alias. If the column alias does not apply, this is the column name. |
Supports the following values:
|
|
19 |
SQL_DESC_NULLABLE |
Whether NULL can be specified for the column.
|
Supports the following values:
|
SQLSMALLINT |
20 |
SQL_DESC_NUM_PREC_RADIX |
Whether the data type of the SQL_DESC_TYPE field is an approximate value data type or an exact numeric value data type.
|
Supports the following values:
|
SQLINTEGER |
21 |
SQL_DESC_OCTET_LENGTH |
Length in bytes of a character string or binary data type. |
Supports the following value:
|
SQLLEN |
22 |
SQL_DESC_OCTET_LENGTH_PTR |
Variable that contains the total length in bytes of a dynamic argument (for parameter descriptors) or a bound column value (for row descriptors). |
Supports the following values:
|
SQLLEN * |
23 |
SQL_DESC_PARAMETER_TYPE |
Parameter type (input, output, or input/output).
|
Supports the following values:
|
SQLSMALLINT |
24 |
SQL_DESC_PRECISION |
Number of digits for an exact numeric type and the number of bits in the mantissa (binary precision) for an approximate value type. |
Supports the following values according to the data type:
|
SQLSMALLINT |
25 |
SQL_DESC_SCALE |
Defined scale for decimal and numeric data types. Defined scale. |
Supports the following values:
|
SQLSMALLINT |
26 |
SQL_DESC_SCHEMA_NAME |
Schema name of the base table that stores the column. |
Supports the following value:
|
|
27 |
SQL_DESC_SEARCHABLE |
Whether the column can be used in a WHERE clause.
|
Supports the following value:
|
SQLSMALLINT |
28 |
SQL_DESC_TABLE_NAME |
Name of the base table that stores the column. |
Supports the following value:
|
|
29 |
SQL_DESC_TYPE |
|
Supports the following values:
|
SQLSMALLINT |
30 |
SQL_DESC_TYPE_NAME |
Data type name that depends on the data source. If the data type is unknown, a null character string is specified. |
Supports the following values:
|
|
31 |
SQL_DESC_UNNAMED |
Whether a column name or a column alias was specified in the SQL_DESC_NAME field.
|
Supports the following values:
|
SQLSMALLINT |
32 |
SQL_DESC_UNSIGNED |
Whether the column's data type is signed or unsigned.
|
Supports the following values:
|
SQLSMALLINT |
33 |
SQL_DESC_UPDATABLE |
Whether the column in the result set can be updated.
|
Supports the following value:
|
SQLSMALLINT |
34 |
SQL_COLUMN_LENGTH |
A field defined in ODBC 2.0. |
Supports the following values according to the data type:
|
SQLLEN |
35 |
SQL_COLUMN_PRECISION |
A field defined in ODBC 2.0. |
Supports the following values:
|
SQLSMALLINT |
36 |
SQL_COLUMN_SCALE |
A field defined in ODBC 2.0. |
Supports the following values:
|
SQLSMALLINT |
- #
-
p indicates the fractional seconds precision with a maximum length of 12 digits.
If there is a fractional second, add the value in parentheses.