SQLGetDescRec - Get descriptor record

Purpose

SQLGetDescRec() obtains an entire record from a descriptor. SQLGetDescRec() is a more concise alternative to the SQLGetDescField() function.

Syntax

SQLRETURN SQLGetDescRec    (SQLHDESC       hdesc,
                            SQLSMALLINT    irec,
                            SQLCHAR        *rgbDesc,
                            SQLSMALLINT    cbDescMax,
                            SQLSMALLINT    *pcbDesc,
                            SQLSMALLINT    *type,
                            SQLSMALLINT    *subtype,
                            SQLINTEGER     *length,
                            SQLSMALLINT    *prec,
                            SQLSMALLINT    *scale,
                            SQLSMALLINT    *nullable);

Function arguments

Table 1. SQLGetDescRec arguments
Data type Argument Use Description
SQLCHAR * rgbDesc Output NAME field for the record.
SQLHDESC hdesc Input Descriptor handle.
SQLINTEGER * length Output LENGTH field for the record.
SQLSMALLINT * nullable Output NULLABLE field for the record.
SQLSMALLINT * pcbDesc Output Total length of the output data.
SQLSMALLINT * prec Output PRECISION field for the record.
SQLSMALLINT * scale Output SCALE field for the record.
SQLSMALLINT * subtype Output DATETIME_INTERVAL_CODE, for records whose TYPE is SQL_DATETIME.
SQLSMALLINT * type Output TYPE field for the record.
SQLSMALLINT cbDescMax Input Maximum number of bytes to store in rgbDesc.
SQLSMALLINT irec Input The number of records in the descriptor matches the number of columns in the result set for a row descriptor, or the number of parameters in a parameter descriptor.

Usage

Calling SQLGetDescRec() retrieves all the data from a descriptor record in one call. It might still be necessary to call SQLGetDescField() with SQL_DESC_COUNT to determine the number of records in the descriptor.

Return codes

Diagnostics

Table 2. SQLGetDescRec SQLSTATEs
SQLSTATE Description Explanation
HY009 Argument value that is not valid The value specified for the argument irec is not valid.

The argument rgbDesc, pcbDesc, type, subtype, length, prec, scale or nullable is a null pointer.

HY013 * Memory management problem The driver is unable to access memory required to support the processing or completion of the function.

Start of changeHY021End of change

Start of changeInternal descriptor that is not validEnd of change

Start of changeThe internal descriptor cannot be addressed or allocated, or it contains a value that is not valid.End of change

References