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 > Having issues when calling a stored procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-21-08, 18:11
blackhawk_123 blackhawk_123 is offline
Registered User
 
Join Date: Jul 2008
Posts: 17
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
Reply With Quote
  #2 (permalink)  
Old 08-21-08, 20:34
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Connect as user BOSS or issue SET CURRENT SCHEMA BOSS before the SP call.
Reply With Quote
  #3 (permalink)  
Old 08-22-08, 02:15
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #4 (permalink)  
Old 08-22-08, 13:57
blackhawk_123 blackhawk_123 is offline
Registered User
 
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.
Reply With Quote
  #5 (permalink)  
Old 08-22-08, 14:35
blackhawk_123 blackhawk_123 is offline
Registered User
 
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?
Reply With Quote
  #6 (permalink)  
Old 08-22-08, 17:59
blackhawk_123 blackhawk_123 is offline
Registered User
 
Join Date: Jul 2008
Posts: 17
it worked when I set the current path to boss.
Thank you all.
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