Descriptor header and record field initialization values (CLI)
Depending on which descriptor
header fields that you use, you might have a field that is already
initialized with a default value or have a field which is read/write
(R/W) or read-only (R).
The following tables list the initialization of each field for each type of descriptor, with D indicating that the field is initialized with a default, and ND indicating that the field is initialized without a default. If a number is shown, the default value of the field is that number. The tables also indicate whether a field is read/write (R/W) or read-only (R).
Descriptor header field | Type | Readable and writable (R/W) or read-only (R) | Initialization value |
---|---|---|---|
SQL_DESC_ALLOC_TYPE | SQLSMALLINT |
|
|
SQL_DESC_ARRAY_SIZE | SQLUINTEGER |
|
|
SQL_DESC_ARRAY_STATUS_PTR | SQLUSMALLINT * |
|
|
SQL_DESC_BIND_OFFSET_PTR | SQLINTEGER * |
|
|
SQL_DESC_BIND_TYPE | SQLINTEGER |
|
|
SQL_DESC_COUNT | SQLSMALLINT |
|
|
SQL_DESC_ROWS_
PROCESSED_PTR |
SQLUINTEGER * |
|
|
- a
- These fields are defined only when the IPD is automatically populated by CLI. If the fields are not automatically populated then they are undefined. If an application attempts to set these fields, SQLSTATE HY091 (Invalid descriptor field identifier.) will be returned.
The initialization of record fields is as follows:
Descriptor record field | Type | Readable and writable (R/W) or read-only (R) | Initialization value |
---|---|---|---|
SQL_DESC_AUTO_UNIQUE_VALUE | SQLINTEGER |
|
|
SQL_DESC_BASE_COLUMN_NAME | SQLCHAR * |
|
|
SQL_DESC_BASE_TABLE_NAME | SQLCHAR * |
|
|
SQL_DESC_CASE_SENSITIVE | SQLINTEGER |
|
|
SQL_DESC_CATALOG_NAME | SQLCHAR * |
|
|
SQL_DESC_CONCISE_TYPE | SQLSMALLINT |
|
|
SQL_DESC_DATA_PTR | SQLPOINTER |
|
|
SQL_DESC_DATETIME_
INTERVAL_CODE |
SQLSMALLINT |
|
|
SQL_DESC_DATETIME_
INTERVAL_PRECISION |
SQLINTEGER |
|
|
SQL_DESC_DISPLAY_SIZE | SQLINTEGER |
|
|
SQL_DESC_FIXED_PREC_SCALE | SQLSMALLINT |
|
|
SQL_DESC_IDENTITY_VALUE | SQLINTEGER |
|
|
SQL_DESC_INDICATOR_PTR | SQLINTEGER * |
|
|
SQL_DESC_LABEL | SQLCHAR * |
|
|
SQL_DESC_LENGTH | SQLUINTEGER |
|
|
SQL_DESC_LITERAL_PREFIX | SQLCHAR * |
|
|
SQL_DESC_LITERAL_SUFFIX | SQLCHAR * |
|
|
SQL_DESC_LOCAL_TYPE_NAME | SQLCHAR * |
|
|
SQL_DESC_NAME | SQLCHAR * |
|
|
SQL_DESC_NULLABLE | SQLSMALLINT |
|
|
SQL_DESC_NUM_PREC_RADIX | SQLINTEGER |
|
|
SQL_DESC_OCTET_LENGTH | SQLINTEGER |
|
|
SQL_DESC_OCTET_LENGTH_PTR | SQLINTEGER * |
|
|
SQL_DESC_PARAMETER_TYPE | SQLSMALLINT |
|
|
SQL_DESC_PRECISION | SQLSMALLINT |
|
|
SQL_DESC_SCALE | SQLSMALLINT |
|
|
SQL_DESC_SCHEMA_NAME | SQLCHAR * |
|
|
SQL_DESC_SEARCHABLE | SQLSMALLINT |
|
|
SQL_DESC_TABLE_NAME | SQLCHAR * |
|
|
SQL_DESC_TYPE | SQLSMALLINT |
|
|
SQL_DESC_TYPE_NAME | SQLCHAR * |
|
|
SQL_DESC_UNNAMED | SQLSMALLINT |
|
|
SQL_DESC_UNSIGNED | SQLSMALLINT |
|
|
SQL_DESC_UPDATABLE | SQLSMALLINT |
|
|
SQL_DESC_CARDINALITY | SQLLEN |
|
|
SQL_DESC_CARDINALITY_PTR | SQLLEN * |
|
|
- a
- These fields are defined only when the IPD is automatically populated by CLI. If the fields are not automatically populated then they are undefined. If an application attempts to set these fields, SQLSTATE HY091 (Invalid descriptor field identifier.) will be returned.
- b
- The SQL_DESC_DATA_PTR field in the IPD can be set to force a consistency
check. In a subsequent call to
SQLGetDescField()
orSQLGetDescRec()
, CLI is not required to return the value that SQL_DESC_DATA_PTR was set to.