SQLSetDescRec() sets all the attributes for a descriptor record. SQLSetDescRec() is a more concise alternative to the SQLDescField() function.
SQLRETURN SQLSetDescRec (SQLHDESC hdesc,
SQLSMALLINT irec,
SQLSMALLINT type,
SQLSMALLINT subtype,
SQLINTEGER length,
SQLSMALLINT prec,
SQLSMALLINT scale,
SQLPOINTER data,
SQLINTEGER *sLen,
SQLINTEGER *indic);
Data type | Argument | Use | Description |
---|---|---|---|
SQLDESC | hdesc | Input | Descriptor handle. |
SQLINTEGER * | indic | Input (deferred) | INDICATOR_PTR field for the record. |
SQLINTEGER * | sLen | Input (deferred) | LENGTH_PTR field for the record. |
SQLINTEGER | length | Input | LENGTH field for the record. |
SQLPOINTER | data | Input (deferred) | DATA_PTR field for the record. |
SQLSMALLINT | irec | Input | Record number within the descriptor. |
SQLSMALLINT | prec | Input | PRECISION field for the record. |
SQLSMALLINT | scale | Input | SCALE field for the record. |
SQLSMALLINT | subtype | Input | DATETIME_INTERVAL_CODE field for records whose TYPE is SQL_DATETIME. |
SQLSMALLINT | type | Input | TYPE field for the record. |
Calling SQLSetDescRec() sets all the fields in a descriptor record in one call.
SQLSTATE | Description | Explanation |
---|---|---|
HY009 | Argument value that is not valid | The value specified for the argument irec is
less than 1. A value that is not valid for another argument is specified. |
HY016 | Descriptor that is not valid | The descriptor handle referred to an implementation row descriptor. |
HY021 | Internal descriptor that is not valid | The internal descriptor cannot be addressed or allocated, or it contains a value that is not valid. |