Deallocating a prepared statement frees any resources associated with it. Explicit deallocation is optional; if the application does not explicitly deallocate prepared statements, the server deallocates them when the client program disconnects.
If a cursor is declared on the prepared statement, the application must first deallocate the cursor before deallocating the statement. See “Step 6: Deallocate the cursor” for details.
To initiate a command to deallocate the prepared statement, the application calls ct_dynamic with type as CS_DEALLOC and id as the statement identifier. ct_send sends the command to the server, and a standard ct_results loop handles the results.