Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    127

    Unanswered: Procedure fails when i missed the schema name in its call

    Hi,

    1. I ve set current schema to test
    2. created a procedure PROC1 and compiled it successfully.
    3. When i tried to execute the procedure in the command line processor,
    Code:
    db2 -td@ -f proc1
    it returned an error saying that there is no such routines..


    4. when i tried
    Code:
    db2 -td@ -f test.proc1
    it executed successfully.

    My question is why the procedure proc1 failed when i called it without the schema name (even though the current schema is set to test in which the procedure is created and compiled.)

    regards,
    Sn

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Like current schema is used for tables,views etc,
    current function path is used for UDFs and SPs.

    SET CURRENT FUNCTION PATH=ABCD,EFGH

    Call TEST1()

    will call procedure ABCD.TEST1().

    If EFGH.TEST1() also exists, then the one with schema ABCD is called because it comes first in the FUNCTION PATH, more or less like OS's PATH variable

    HTH

    Sathyaram




    Quote Originally Posted by Shefu
    Hi,

    1. I ve set current schema to test
    2. created a procedure PROC1 and compiled it successfully.
    3. When i tried to execute the procedure in the command line processor,
    Code:
    db2 -td@ -f proc1
    it returned an error saying that there is no such routines..


    4. when i tried
    Code:
    db2 -td@ -f test.proc1
    it executed successfully.

    My question is why the procedure proc1 failed when i called it without the schema name (even though the current schema is set to test in which the procedure is created and compiled.)

    regards,
    Sn
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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