An application that is handling server messages inline retrieves the CS_COMMAND with the extended error data by calling ct_diag with operation as CS_EED_CMD:
CS_RETCODE ret;
CS_COMMAND *eed_cmd;
CS_INT index;
ret = ct_diag (connection, CS_EED_CMD,
CS_SERVERMSG_TYPE, index, &eed_cmd);
In this call, type must be CS_SERVERMSG_TYPE and index must be the index of the message for which extended error data is available. ct_diag sets eed_cmd to point to the CS_COMMAND on which the extended error data is available.
After it has the CS_COMMAND, the application processes the extended error data as a normal parameter result set, calling ct_res_info,ct_describe, ct_bind, ct_fetch, and ct_get_data to describe, bind, and fetch the parameters. It is not necessary for the application to call ct_results.