Execute a SELECT that returns multiple rows

The demo4.ec sample program shows how to execute a dynamic SELECT statement with the following conditions:
  • The SELECT returns more than one row.

    The SELECT must be associated with a cursor, executed with the OPEN statement, and have its return values retrieved with the FETCH...USING SQL DESCRIPTOR statement.

  • The SELECT has either no input parameters or no WHERE clause.

    The OPEN statement does not need to include the USING clause.

  • The SELECT has unknown columns in its select list.

    The FETCH statement includes the USING SQL DESCRIPTOR clause to store the return values in an sqlda structure.