Using Data-at-Execution Parameters
To handle data-at-execution text or image parameters
-
When calling SQLBindParameter to bind a program buffer to the statement parameter:
-
Use a pcbValue of SQL_LEN_DATA_AT_EXEC(length) where length is the total length of the text or image parameter data.
-
Use an rgbValue of a program-defined parameter identifier.
-
Calling SQLExecDirect or SQLExecute returns SQL_NEED_DATA, which indicates that data-at-execution parameters are ready for processing.
-
For each data-at-execution parameter
-
Call SQLParamData to get the program-defined parameter ID. It will return SQL_NEED_DATA if there is another data-at-execution parameter.
-
Call SQLPutData one or more times to send the parameter data, until length is sent.
-
Call SQLParamData to indicate that all the data for the final data-at-execution parameter has been sent. It will not return SQL_NEED_DATA.