Step 4: Execute the prepared statement

To initiate a command to execute the prepared statement, the application calls ct_dynamic with type as CS_EXECUTE and id as the statement identifier. The application must define any parameters required to execute the prepared statement. Parameter values can be defined in one of several ways:

The application can determine the number and format of a prepared statement’s parameters by sending a describe-input command and handling the results before executing the prepared statement. See “Step 2: Get a description of command inputs”.

ct_send sends the command to the server, and a standard ct_results loop handles the results. Code your application to handle the results with a standard results loop, as discussed in “Structure of the basic loop”.