× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 17 Oct 2013 07:17, Sarvapriya Tripathi wrote:

I have a requirement where I need to supply multiple results sets
from an RPGLE Stored Proc. Normally I would utilize SQL Cursors for
this like the following code snippet:

// Define SQL statements...
...
// Create cursors and return...
EXEC SQL PREPARE STMT1 FROM :@Sqlstmt1 ;
EXEC SQL DECLARE cursor1 CURSOR WITH RETURN TO CLIENT FOR STMT1 ;
EXEC SQL PREPARE STMT2 FROM :@Sqlstmt2 ;
EXEC SQL DECLARE cursor2 CURSOR WITH RETURN TO CLIENT FOR STMT2 ;
EXEC SQL OPEN cursor1;
EXEC SQL OPEN cursor2;

But unfortunately, in my current case I am faced with a situation
where a SQL statement cannot be used and I have to gather data using
traditional approach. I can build all the data in multiple DS
Arrays, but is it possible to create cursors out of the arrays? If so
how?

If not, does anyone know of any other trick to return multiple DS
Arrays as result sets from a Stored Proc?


From a very recent discussion regarding SET RESULT SETS statement, the documentation seems to suggest only one per program. Links to the message thread, and to my two replies with doc link and doc snippets:

Subject: Returning Multiple Result Sets from RPG with External Stored Procedure
Date: Thu, 3 Oct 2013 12:50:24 -0500
http://archive.midrange.com/rpg400-l/201310/threads.html#00059
http://archive.midrange.com/rpg400-l/201310/msg00070.html
http://archive.midrange.com/rpg400-l/201310/msg00078.html


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.