An application can call SQLGetDescField to return the value of a single field of a descriptor record. A call to SQLGetDescField can return the setting of any field in any descriptor type, including header fields, record fields, and bookmark fields. An application can obtain the settings of multiple fields in the same or different descriptors, in arbitrary order, by making repeated calls to SQLGetDescField. SQLGetDescField can also be called to return driver-defined descriptor fields.
For performance reasons, an application should not call SQLGetDescField for an IRD before executing a statement.
The settings of multiple fields that describe the name, data type, and storage of column or parameter data can also be retrieved in a single call to SQLGetDescRec. SQLGetStmtAttr can be called to return the setting of a single field in the descriptor header that is also a statement attribute. SQLColAttribute, SQLDescribeCol, and SQLDescribeParam return record or bookmark fields.
When an application calls SQLGetDescField to retrieve the value of a field that is undefined for a particular descriptor type, the function returns SQL_SUCCESS but the value returned for the field is undefined. For example, calling SQLGetDescField for the SQL_DESC_NAME or SQL_DESC_NULLABLE field of an APD or ARD will return SQL_SUCCESS but an undefined value for the field.
When an application calls SQLGetDescField to retrieve the value of a field that is defined for a particular descriptor type but that has no default value and has not been set yet, the function returns SQL_SUCCESS but the value returned for the field is undefined. For more information on the initialization of descriptor fields and descriptions of the fields, see "Initialization of Descriptor Fields" in SQLSetDescField. For more information on descriptors, see Descriptors.