If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Procedure fails when i missed the schema name in its call

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-20-06, 05:21
Shefu Shefu is offline
Registered User
 
Join Date: Apr 2005
Posts: 127
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
Reply With Quote
  #2 (permalink)  
Old 01-20-06, 05:23
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On