In addition to indicating the type of result set that is available for processing, ct_results sets result_type to the values below to indicate the status of command processing:
CS_CMD_DONE – indicates that the results of a logical command have been completely processed. See “Logical commands” for an explanation of this term.
CS_CMD_SUCCEED – indicates the success of a command that returns no data, such as a Transact-SQL insert or delete command.
CS_CMD_FAIL – indicates that, due to error, the server failed to execute a server command. For example, the text of a language command might contain a syntax error or refer to a nonexistent object. In most cases, the server returns a server message that describes the error.
Because a Client-Library command can execute multiple server commands, an application must either:
Continue to call ct_results to process results generated by any other server commands contained in the original Client-Library command, or
Call ct_cancel(CS_CANCEL_ALL) to cancel the Client-Library command and discard its results.