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



David, I ran this in iNav's Run Sql Scripts tool and looks like it works.
You should be able to simply paste it in the window and click on Run->All.

/* Start script */

CREATE PROCEDURE QGPL.PROC1()
RESULT SET 1
LANGUAGE SQL
BEGIN 
   DECLARE MYCURSOR1 CURSOR WITH RETURN TO CLIENT FOR 
     SELECT * FROM SYSIBM.SYSDUMMY1;
   OPEN MYCURSOR1;
END;

CREATE PROCEDURE QGPL.PROC2()
RESULT SET 1
LANGUAGE SQL
BEGIN 
   DECLARE MYCURSOR2 CURSOR WITH RETURN TO CLIENT FOR 
     SELECT * FROM SYSIBM.SYSDUMMY1;
   OPEN MYCURSOR2;
END;

CREATE PROCEDURE QGPL.PROC3()
RESULT SET 1
LANGUAGE SQL
BEGIN 
   DECLARE MYCURSOR3 CURSOR WITH RETURN TO CLIENT FOR 
     SELECT * FROM SYSIBM.SYSDUMMY1;
   OPEN MYCURSOR3;
END;

CREATE PROCEDURE qgpl.FINALPROC1()
RESULT SETS 3
LANGUAGE SQL
BEGIN
  CALL QGPL.PROC1();
  CALL QGPL.PROC2();
  CALL QGPL.PROC3();
END;

CALL QGPL.FINALPROC1();

/* End script */

Hope that helps.

Elvis

-----Original Message-----
Subject: SQL Result Sets From Multiple Procedures

If I have three procedures each returning one result set, can I create a
fourth procedure that calls the three and returns all three result sets?

David Smith



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.