Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2007
    Posts
    10

    Unanswered: nested stored procedures returning result sets in db2 v8 for Z/OS

    How to return the result sets from one procedure to the another in case of nested stored procedures in db2 v8 for Z/OS

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    When you declare a cursor for a result set, you can specify WITHOUT RETURN (which is the default), or WITH RETURN TO CALLER. The latter will ensure that the cursor is not closed at the end of the procedure implicitly. The calling procedure can then use the ASSOCIATE RESULT SET LOCATOR statement to get a handle on the result set returned by the called procedure.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    Apr 2007
    Posts
    10
    Thanks for the quick response.I have one more question.
    As per my knowledge on SQLDA(SQL Descriptor area), it can be used to get the details of number of columns,column names and their data type,length in a result set by using describe cursor statement.Could you throw some light on SQL Descriptor area?Will this be of any use in solving the nested procedures issue?

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    SQLDA is relevant to host languages only. If your calling procedure is written in SQL, you don't have an SQLCA. Also, result sets from SPs can only be accessed from applications using JDBC or CLI and not embedded SQL.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  5. #5
    Join Date
    Apr 2007
    Posts
    10
    Thanks for the reply.
    Thanks in advance for my next question.
    How to proceed with when the number result sets returned by called procedure is not known in the calling procedure?Is there anything like describe procedure or describe cursor.

  6. #6
    Join Date
    Apr 2007
    Posts
    10
    How can we create the required number of RESULT SET LOCATOR's when the number of result sets returned by called procedure is not known ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •