This binds a buffer to a column in the result set. The buffer is updated when SQLFetch is called. New columns from the result set are then read in.
SQLBindCol can be called after or before the statement is prepared and executed, as long as it is called before SQLFetch is called.
Syntax:
RETCODE SQLBindCol (hStmt, columnNo, targetType, targetValue, targetSize, actualSize);
Arguments:
The arguments fro SQLBindCol are listed in below table.
| Type | Name | Description |
| SQLHSTMT | hStmt | Statement handle |
| SQLUSMALLINT | columnNo | The number of the column of the result set to bind to |
| SQLSMALLINT | targetType | The C data type of the buffer |
| SQLPOINTER | targetValue | Pointer to buffer to hold the column data |
| SQLINTEGER | targetSize | Size of the buffer in bytes |
| SQLINTEGER * | actualSize | Pointer buffer to hold the size of the data |
Returns: This function returns SQL-SUCCESS if it is successful , else SQL_ERROR.