Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    2

    Unanswered: Parameters & Stored Procedures

    My question is how or can I access the returned parameter from stored procedure SPB within stored procedure SPA?

    For example:

    Code:
    A: BEGIN
    DECLARE v_someVal INTEGER;
    CALL SPB();
    SET v_someVal = returneded parameter SPB;
    END A

    Details:
    • DB2 z/OS version 8
    • storedProcedure_B() returns 1 parameter
    • v_someVal should be set to SP_B's returned parameter


    Thanks for any help,
    JAJ

  2. #2
    Join Date
    May 2003
    Posts
    113
    You need to define the parameter as OUT Parm or INOUT Parm. Then, you can use it as:

    Code:
    A: BEGIN
    DECLARE v_someVal INTEGER;
    CALL SPB(:v_someVal);
    SET v_someVal = returneded parameter SPB;
    END A
    Quote Originally Posted by JAJ
    My question is how or can I access the returned parameter from stored procedure SPB within stored procedure SPA?


    For example:

    Code:
    A: BEGIN
    DECLARE v_someVal INTEGER;
    CALL SPB();
    SET v_someVal = returneded parameter SPB;
    END A

    Details:
    • DB2 z/OS version 8
    • storedProcedure_B() returns 1 parameter
    • v_someVal should be set to SP_B's returned parameter


    Thanks for any help,
    JAJ

  3. #3
    Join Date
    Jun 2008
    Posts
    2

    Parameters & Stored Procedures

    Thanks for your reply. That worked. I no longer need the set my val now. I can simply do:

    Code:
    A: BEGIN
    DECLARE v_someVal INTEGER;
    CALL storedProcedure_B(v_someVal);
    END A
    Later,
    JAJ

Posting Permissions

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