Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2012-09-07T06:47:53Z by SystemAdmin
SystemAdmin
SystemAdmin
5837 Posts
ACCEPTED ANSWER

Pinned topic Cursor names for stored procedures exposing result sets

‏2012-08-30T07:31:24Z |
Hello,

The documentation of the CALL command,

http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.sql.ref.doc%2Fdoc%2Fr0000897.html

states that "if the calling program is written using CLI, JDBC, or SQLJ, or the caller is an SQL procedure, result sets can be returned directly to the caller. The procedure indicates that a result set is to be returned by declaring a cursor on that result set, opening a cursor on the result set, and leaving the cursor open when exiting the procedure."

My question is : how can I know the name of the cursor if I did not write the procedure ?

For example, the built-in REORGCHK_TB_STATS and REORGCHK_IX_STATS return result sets : how can I guess the name of the cursor to OPEN from a calling SQL procedure in order to exploit that result set ?

Thanks for your help!

Yves-Antoine Emmanuelli
Updated on 2012-09-07T06:47:53Z at 2012-09-07T06:47:53Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    5837 Posts
    ACCEPTED ANSWER

    Re: Cursor names for stored procedures exposing result sets

    ‏2012-08-30T18:30:00Z  in response to SystemAdmin
    The name of the cursor is irrelevant. To an application it is just a Result Set.

    Andy
  • SystemAdmin
    SystemAdmin
    5837 Posts
    ACCEPTED ANSWER

    Re: Cursor names for stored procedures exposing result sets

    ‏2012-09-07T06:47:53Z  in response to SystemAdmin
    Hello,

    The answer to my question is here :

    http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.apdv.sqlpl.doc%2Fdoc%2Ft0009168.html

    Regards

    Yves-Antoine Emmanuelli