Processing parameter results

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:

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