Returning multiple result sets

You can use Interactive SQL to return more than one result set from a procedure.

Prerequisites

There are no prerequisites for this task.

Task

By default, Interactive SQL does not show multiple result sets.

  1. In Interactive SQL, connect to the database.
  2. Click Tools » Options.
  3. Click SAP Sybase IQ.
  4. On the Results tab, click Show All Result Sets.
  5. Click OK.

After you enable this option, Interactive SQL shows multiple result sets. The setting takes effect immediately and remains in effect for future sessions until it is disabled.

Next

If a RESULT clause is included in a procedure definition, the result sets must be compatible: they must have the same number of items in the SELECT lists, and the data types must all be of types that can be automatically converted to the data types listed in the RESULT clause.

If the RESULT clause is omitted, a procedure can return result sets that vary in the number and type of columns that are returned.