Results-handling for language commands

Code your application to handle the results of a language command with a standard results loop, as discussed in “Structure of the basic loop”.

Language commands can return the result types listed in Table 5-2, for the given reasons:

Table 5-2: Result types from the execution of a language command

Result type

Meaning/when received

CS_ROW_RESULT

Regular rows, sent in response to a select statement executed by the language batch or by a called stored procedure.

CS_COMPUTE_RESULT

Compute rows, sent in response to a selectstatement that contains a compute clause. The select statement can be executed by the language batch or by a called stored procedure.

CS_PARAM_RESULT

Output parameter values, sent in response to an exec statement that passes parameter values. (Parameters must be qualified with output in the exec statement.) Output parameter values are received after the results of all statements executed by the procedure.

CS_STATUS_RESULT

A stored procedure’s return status, sent in response to an exec statement. The return status is received after the results from all statements executed by the procedure.

CS_COMPUTEFMT_ RESULT, CS_ROWFMT_RESULT

Format results, seen only if the CS_EXPOSE_FMTS connection property is CS_TRUE (the default is CS_FALSE).

CS_CURSOR_ RESULT

Cursor result rows are retrievable using ct_fetch or ct_scroll_fetch.

CS_CMD_DONE

Placeholder to indicate that the results of one logical command have been processed. Seen after the following events:

  • The results from each statement executed in the language batch have been processed.

  • The results of each select statement executed by a called stored procedure have been completely processed.

CS_CMD_SUCCEED

Indicates the success of an insert, update, or exec statement that was executed directly by the language batch.

CS_CMD_FAIL

Indicates that the command or a statement within the language batch failed to execute.