Descriptor manipulation without using descriptor handles in CLI applications
Many CLI functions
use descriptors, but an application does not have to manipulate the
descriptors directly. Instead, the application can use a different
function that sets or retrieves one or more fields of a descriptor.
This category of CLI functions
is called concise functions.
The
SQLBindCol() function
is an example of a concise function that manipulates descriptor fields.In addition to manipulating multiple fields, concise functions are called without explicitly specifying the descriptor handle. The application does not even need to retrieve the descriptor handle to use a concise function.
The following types of concise functions exist:
- The functions
SQLBindCol()andSQLBindParameter()bind a column or parameter by setting the descriptor fields that correspond to their arguments. These functions also perform other tasks unrelated to descriptors.If required, an application can also use the descriptor calls directly to modify individual details of a binding. In this case the descriptor handle must be retrieved, and the functions
SQLSetDescField()orSQLSetDescRec()are called to modify the binding. - The following functions always retrieve values in descriptor fields:
SQLColAttribute()SQLDescribeCol()SQLDescribeParam()SQLNumParams()SQLNumResultCols()
- The functions
SQLSetDescRec()andSQLGetDescRec()set or get the multiple descriptor fields that affect the data type and storage of column or parameter data. A single call toSQLSetDescRec()can be used to change the values used in the binding of a column or parameter. - The functions
SQLSetStmtAttr()andSQLGetStmtAttr()modify or return descriptor fields in some cases, depending on which statement attribute is specified. Refer to the "Values Stored in a Descriptor" section of the descriptors documentation for more information.