SQLSetDescRec - Set a descriptor record
SQLSetDescRec() sets all the attributes for a descriptor record. SQLSetDescRec() is a more concise alternative to the SQLDescField() function.
Syntax
SQLRETURN SQLSetDescRec (SQLHDESC hdesc, SQLSMALLINT irec, SQLSMALLINT type, SQLSMALLINT subtype, SQLINTEGER length, SQLSMALLINT prec, SQLSMALLINT scale, SQLPOINTER data, SQLINTEGER *sLen, SQLINTEGER *indic);
Function arguments
Table 1. SQLSetDescRec arguments Data type Argument Use Description SQLDESC hdesc Input Descriptor handle. SQLSMALLINT irec Input Record number within the descriptor. SQLSMALLINT type Input TYPE field for the record. SQLSMALLINT subtype Input DATETIME_INTERVAL_CODE field for records whose TYPE is SQL_DATETIME. SQLINTEGER length Input LENGTH field for the record. SQLSMALLINT prec Input PRECISION field for the record. SQLSMALLINT scale Input SCALE field for the record. SQLPOINTER data Input (deferred) DATA_PTR field for the record. SQLINTEGER * sLen Input (deferred) LENGTH_PTR field for the record. SQLINTEGER * indic Input (deferred) INDICATOR_PTR field for the record.
Usage
Calling SQLSetDescRec() sets all the fields in a descriptor record in one call.
Return codes
- SQL_SUCCESS
- SQL_SUCCESS_WITH_INFO
- SQL_ERROR
- SQL_INVALID_HANDLE
Diagnostics
Table 2. SQLSetDescRec SQLSTATEs 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.
References
- SQLBindCol - Bind a column to an application variable
- SQLDescribeCol - Describe column attributes
- SQLExecDirect - Execute a statement directly
- SQLExecute - Execute a statement
- SQLPrepare - Prepare a statement
Parent topic:
DB2 UDB CLI functions