For example, the following statement allocates a handle of type SQL_HANDLE_STMT with name stmt, on a connection with handle dbc:

SQLAllocHandle( SQL_HANDLE_STMT, dbc, &stmt );

Bind parameters for the statement using SQLBindParameter.

For example, the following lines declare variables to hold the values for the department ID, department name, and manager
ID, and for the statement string. They then bind parameters to the first, second, and third parameters of a statement executed
using the stmt statement handle.