this is not a question. It's a solution. Maybe it's an doc enhancement request. :)
We need to process multiple result sets (coming from a CLR external procedure. It took me half an hour to get this running and I just want to share the solution with you. The key is the RESUME statement. I think there should be a usage example of it in the "SQL Anywhere Server - SQL Usage » Stored procedures, triggers, batches, and user-defined functions » Result sets" section of the documentation.
Here's the sample:
asked 13 Jul '16, 05:28
Some of this is covered in the DCX article Store procedures with result sets at the bottom; almost as an after-thought/footnote. But I agree it would be awkward/difficult to map the information from this (Embedded-SQL-centric) article to a PSM usage ... for instance you were able to bypassed the need to describe the new result set (something that is not a PSM concept anyway) by knowing what this new result columns look like and directly representing that in your Fetch-Into statement.
There are numerous other DCX articles that cover this for client apps (dbisql not dbisqlc) and APIs ODBC, JDBC, Ruby, etc ... so maybe it makes sense for this to get it's own article. It does seem to be something that probably was not as much of a requirement since procedures usually are the 'return-or-of' multiple sets and less commonly a 'return-ee-for' multiple result sets and don't often have a needs to retrieve them.
Some possible caveats: this is a Watcom SQL behaviour (and not only becuase the RESUME statement is proprietary), ... and T/SQL stored procedures will likely behave differently. That latter caveat not being a concern for this case but may be important for other readers of this thread to be aware of.