SQLGetDescRec() obtains an entire record from a descriptor. SQLGetDescRec() is a more concise alternative to the SQLGetDescField() function.
SQLRETURN SQLGetDescRec (SQLHDESC hdesc, SQLSMALLINT irec, SQLCHAR *rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, SQLSMALLINT *type, SQLSMALLINT *subtype, SQLINTEGER *length, SQLSMALLINT *prec, SQLSMALLINT *scale, SQLSMALLINT *nullable);
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. |
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.
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. |
HY021 |
Internal descriptor that is not valid |
The internal descriptor cannot be addressed or allocated, or it contains a value that is not valid. |