Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2007
    Posts
    20

    Unanswered: Stored procedure in db2 which accepts any number of Arguments

    hi everyone..

    i am working on DB2 UDB.
    I Need a stored procedure in db2 which accepts any number of arguements..

    regards,

    M.Sampath.

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You cannot do it. What are you trying to do? Also give DB2 version and OS.

    Andy

  3. #3
    Join Date
    Mar 2007
    Posts
    20
    The Requirement is that when we pass any no. of arguements it should accept it.


    The version is Db2 V 8.2
    OS -- Linux

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    I understand your requirement even though it cannot be done. What I do not understand is what you want the SP to do. Maybe I can help with a work around.

    Andy

  5. #5
    Join Date
    Mar 2007
    Posts
    20
    The criteria is the when we pass some IN Parameter( i.e some table names) so if some changes are made to the tables ,I must be in a position to pas all the table names in a loop.

    I hope u got my point.

    sampath

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    No, I do not get your point. Please explain further. Perhaps some examples might help.

    Andy

  7. #7
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    The only option that you have is to
    1. not register the stored procedure, and
    2. use the parameter style DB2DARI


    The consequence is that you would have to call the procedure this way:
    Code:
    CALL library!function(...)
    I'm not sure if V8 still supports that mode. The DB2DARI parameter style is no longer supported (except for applications that require it for backward compatibility).

    What I would do in your situation is to use a single table whose rows will describe the parameters that influence your procedure logic. The procedure scan over the table and does whatever it should do.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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