Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2008
    Posts
    17

    Unanswered: Having issues when calling a stored procedure

    Hi all,

    I am trying to call a stroed procedure

    db2 " call p_prcname(?,?)"
    SQL0440N No authorized routine named "P_PRCNAME" of type "PROCEDURE"
    having compatible arguments was found. SQLSTATE=42884

    But it works when I call like this
    db2 " call boss.p_prcname(?,?)"

    where boss is the schema name.

    Can someone tell me how to over come this issue? I want to call the stored procedure without any prefix.
    THANK YOU ALL IN ADVANCE

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Connect as user BOSS or issue SET CURRENT SCHEMA BOSS before the SP call.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Adding to that: All database objects have a fully qualified name consisting of a schema name and an unqualified name. (This is standard SQL.) The schema name can be omitted, in which case the CURRENT SCHEMA special register is consulted (or the CURRENT FUNCTION PATH for routines) to resolve the object. The CURRENT SCHEMA special register is initialized by default with the current user-id.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  4. #4
    Join Date
    Jul 2008
    Posts
    17
    set current schema boss didnt work it was giving me the same error.
    the username and schema name are different is this going to be a problem.

  5. #5
    Join Date
    Jul 2008
    Posts
    17
    Adding to the above if the user name and the schema are the same I am able to execute the procedure, but when they are different I am getting this error. Any suggestions please?

  6. #6
    Join Date
    Jul 2008
    Posts
    17
    it worked when I set the current path to boss.
    Thank you all.

Posting Permissions

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