Processing result sets

To retrieve and process a single result set from a component:

  1. Call the component method on the stub instance that returns a result set.

  2. Iterate through each row and then each column in a row by using nested for loops.

  3. Use the discriminator method (_d) to retrieve the datatype of the column in a row and switch/case syntax to process the column values (such as printing the column values).

To retrieve and process multiple result sets returned from a component method as a TabularResults::ResultSets object:

  1. Call the component method on the component reference that returns the result sets.

  2. Retrieve the length or number of result sets.

  3. Iterate through the result sets using a for loop.

    For each result set, iterate through each row and then each column in a row by using nested for loops.

    You can treat a ResultSets object as an array of ResultSet objects. On each iteration, retrieve a reference to each ResultSet object by using the subscript [ ] operator.

  4. Use the discriminator method (_d) to retrieve the datatype of the column in a row and switch/case syntax to process the column values (such as printing the column values).