Begin detailed description.

This figure is a flowchart that depicts the functions you use in the processes of sending data in pieces and retrieving data in pieces. In this description, sending data in pieces and retrieving data in pieces are presented in two separate tables respectively.

The following table describes the process in which you call functions to send data in pieces. Each row in this table represents a required function call, an optional function call, or a choice between function calls in this process. The functions are presented in the order in which you call them in your application.
Function call Usage Description
SQLAllocHandle() Required Allocates an statement handle.
SQLBindParameter() Required Binds parameter markers in your SQL statement to application variables. Call this function with SQL_DATA_AT_EXEC specified for the fParamType argument. Repeat this call for each parameter marker in your SQL statement.
SQLPrepare() and SQLExecute(), or SQLExecDirect() Required Choice Prepares and executes an SQL query. Returns SQL_NEED_DATA for data-at-execution parameters.
SQLParamData() Required when SQL_NEED_DATA is returned Initializes the data-at-execution process.
SQLPutData() Required when SQL_NEED_DATA is returned Sends a piece of data for the parameter marker that currently needs data. Repeat calls to this function for each piece of data you send.
SQLParamData() Required when SQL_NEED_DATA is returned Indicates that all the pieces of data have been sent. If SQL_NEED_DATA is returned, you must send data for the next parameter marker with additional calls to SQLPutData() and SQLParamData().
SQLFreeHandle() Optional Frees the statement handle.
The following table describes the process in which you call functions to retrieve data in pieces. Each row in this table represents a required function call, an optional function call, or a choice between function calls. The functions are presented in the order in which you call them in your application.
Function call Usage Description
SQLAllocHandle() Required Allocates a statement handle.
SQLPrepare() and SQLExecute(), or SQLExecDirect() Required Choice Prepares and executes an SQL query.
SQLFetch() Required Fetches the result set.
SQLGetData() Required Places column data into an application variable. If this function returns SQL_SUCCESS_WITH_INFO, repeat this function until it returns SQL_SUCCESS.
SQLFreeHandle() Optional Frees the statement handle.

End detailed description.