Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2004
    Posts
    48

    Red face Unanswered: Can I execute a stored proc thru SQL ? (DB2 OS390 ver 7)

    Hi
    Can I execute a stored proc thru SQL ? (DB2 OS390 ver 7)

    Thanks

  2. #2
    Join Date
    Mar 2004
    Posts
    61
    Yes, you can. Use call stored proc name.

  3. #3
    Join Date
    Apr 2004
    Posts
    48
    can you please give me some examples...

    Thanks
    Mahendra

  4. #4
    Join Date
    Mar 2004
    Posts
    61
    Call db2inst1.proc()

  5. #5
    Join Date
    Apr 2004
    Posts
    48

    Smile

    I ment an example with sql statement like SELECT etc...

    I was trying to use the stored proc TDB2PLDD.WCM888
    This SP Accepts a parameter as partial string S1 and gets a value from column A of table 1 where that partial string is found.

    So if we pass the parameter as tdb2pldd.wcm888(CIND) it should return value 'CINDY' from Table 1 if column A of the table is having the value CINDY

    So how shall I frame my Select statement using this stored proc ?


    Thanks for all the help/info

    Mahendra

  6. #6
    Join Date
    Aug 2003
    Location
    Massachusetts, USA
    Posts
    106
    You cannot call a stored proc embedded into a SELECT statement. You can do what you need to do if you create a function. Suggest taking the proc code and creating a function.

  7. #7
    Join Date
    Apr 2004
    Posts
    48
    Thanks dmmac

Posting Permissions

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