SQLBindCol

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.

TypeNameDescription
SQLHSTMThStmtStatement handle
SQLUSMALLINTcolumnNoThe number of the column of the result set to bind to
SQLSMALLINTtargetTypeThe C data type of the buffer
SQLPOINTERtargetValuePointer to buffer to hold the column data
SQLINTEGERtargetSizeSize of the buffer in bytes
SQLINTEGER *actualSizePointer buffer to hold the size of the data

Returns: This function returns SQL-SUCCESS if it is successful , else SQL_ERROR.

Page last modified on September 25, 2009, at 10:04 AM