You can call a Stored Procedure that returns multiple result sets. This is done by having multiple SELECT statements in the stored procedure.
You can also put multiple SELECT statments in a SQLEXEC call. Something like this:
liResults = SQLEXEC(Handle, "select * from table1; select * from table2", "cursor")
When this is done, the value of liResults will be 2 because two result sets were returned (or -1 if an error). The name of the cursors will be CURSOR1 and CURSOR2.
>One of my co workers said that you can retrieve multiple cursors from one pass through.
>
>I have never seen this. The following example of one cursor:
>=SQLEXEC(Handle,"select * from table","cursor1") This will return cursor1.
>The above is the only way I return a cursor and it is only one.
>
>He says he has seen where ypu can create a passthrough and it will return CURSOR1,cursor2,cursor2.
>
>If anyone has done or seen this, please reply and send me an example.