After an application sends a command to a server, it must process any results generated by the command. Types of results include:
Regular row results – rows returned when the server processes a select statement.
Cursor row results – rows returned when the server processes a ct_cursor Client-Library cursor-open command.
Parameter results – fetchable data that can represent:
Output values for an Adaptive Server Enterprise stored procedure’s return parameters
Output values for an Open Server registered procedure’s return parameters
A new timestamp value for an updated text/image column (seen only when processing the results of a ct_command send-data command)
A new timestamp value for a row that was updated with a language command containing a browse-mode update statement
Stored procedure return status results – the return value from an Adaptive Server Enterprise stored procedure or Open Server registered procedure.
Compute row results –intermediate rows returned when the server processes a select statement with a compute by clause.
Message results – a message ID returned by an Open Server application’s message command handler while processing the results of a message command.
Describe results – informational results that describe the format of a prepared dynamic SQL statement’s input parameters or result columns.
Format results – informational results used by Open Server gateway applications to retrieve regular row and compute row formats before the actual data arrives.
A single command can generate more than one type of result. For example, a language command that executes a stored procedure can generate multiple regular row and compute row result sets, a parameter result set, and a return status result set. For this reason, it is important that you code applications to handle all types of results that a server can generate.
The simplest way for an application to handle all result types is to process results in a loop as described in the following section.