A parameter result set contains a single row of parameters.
Several types of data can be returned to an application in the form of a parameter result set, including:
Return parameter values
An Adaptive Server Enterprise stored procedure or an Open Server registered procedure can return output parameter data. The CS_PARAM_RESULT result set contains new values for the procedure’s parameters, as set by the procedure code. See “RPC commands” for a description of how applications execute stored procedures or registered procedures.
Browse mode timestamp values
Browse mode is a scheme that interactive applications can use to perform ad hoc row updates of retrieved rows. Tables involved in browse mode require a timestamp column to control simultaneous access to the data. After a client application executes a browse-mode update statement, Adaptive Server Enterprise returns a parameter result set that contains the new timestamp value for the updated row. See the “Browse Mode” topics page in the Open Client Client-Library/C Reference Manual for more details.
A text or image column timestamp
After a client application updates a text or image column with a send-data command, Adaptive Server Enterprise returns the new text timestamp for the column as a parameter result set. See the “text and image Data Handling” topics page in the Open Client Client-Library/C Reference Manual for more details.
Message result parameters
A message result set consists of a message identifier (see “Processing message results”). The message result set can be followed immediately by a parameter result set containing parameter values that accompany the message result.
An application calls ct_res_info, ct_describe, ct_bind, and ct_fetch to process a parameter result set.
Most synchronous applications use a program structure similar to the following one to process a parameter result set:
case CS_PARAM_RESULT
ct_res_info(CS_NUMDATA) to get the number of parameters
for each parameter:
ct_describe to get a description of the parameter
ct_bind to bind the parameter to a variable
end for
while ct_fetch returns CS_SUCCEED or CS_ROW_FAIL
if CS_SUCCEED
process the row of parameters
else if CS_ROW_FAIL
handle the failure
end if
end while
switch on ct_fetch’s final return code
case CS_END_DATA...
case CS_CANCELED...
case CS_FAIL...
end switch
end case