Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2009
    Posts
    33

    Unanswered: need help with stored procedures

    My stored procedure is trying to call another stored proc and assigning the value to a variable.

    var_count = storedproc1
    I am getting an error stating that
    SQL0206N. pls let me know if the syntax above is right or wrong or assist me with teh same. I have tried looking for references but in vain.

    Regards,
    Sharath

  2. #2
    Join Date
    Nov 2011
    Posts
    24
    Your sub procedure needs to have output parameter and the outer Sp needs to call the sub procedure with a variable inplace of output param.

    The variable will have the output value after calling.

  3. #3
    Join Date
    Jan 2009
    Posts
    33

    procedures need help

    your logic is absolutely fine techday. I am unable to incorporate it .
    as of now i have done it like this

    set var 1 = funcname(param).

    the function i am calling does have a returns keyword and also teh function where i am calling this also has a returns keyword. Would you mind helping me with the syntax on how to call a function inside a function and assigning the output to a variable which is already declared.

    sharath

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    function or stored proc ?
    check samples in sample directory below sqllib
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  5. #5
    Join Date
    Jan 2009
    Posts
    33

    functions

    its regarding functions and checked the samples and info centre. They are pretty basic and what i require is calling a function inside another function and assigning its value to another variable which is declared.

  6. #6
    Join Date
    Nov 2011
    Posts
    24
    Havent tried calling function inside function, but this is how data assignment from function works

    select fname(param) into someparam from sysibm.sysdummy1;

Posting Permissions

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