× 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.



Good Evening,

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?


Thanks and Regards
Sarvapriya M Tripathi





The information contained in this electronic communication and any accompanying document is confidential, may be
attorney-client privileged, and is intended only for the use of the addressee. It is the property of Ryder System,
Inc. Unauthorized use, disclosure or copying of this communication, or any part of it, is strictly prohibited and
may be unlawful. If you have received this communication in error, please notify the sender immediately by return
email, and destroy this communication and all copies of it, including all attachments. Electronic communication
may be susceptible to data corruption, interception and unauthorized tampering and Ryder disclaims all liability
of any kind for such actions or any consequences that may arise directly or indirectly therefrom.

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.