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 > getting errors while using user -defined tables.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-15-04, 11:15
prithvi_raj prithvi_raj is offline
Registered User
 
Join Date: Apr 2004
Posts: 36
Angry getting errors while using user -defined tables.

OS sol2.8
UDB V8.1fp5


Getting the following error

Still get this error:

COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/SUN] SQL0440N No
authorized routine named "INTEGER" of type "FUNCTION" having compatible
arguments was found. SQLSTATE=42884

when i run this query.

SELECT * FROM ENROLLEE_STATE WHERE INTEGER(ENROLLEE_ID)=?


I gave the rights on type ID , using the following stat.
grant execute on function schema.id(integer) to public/schema.

Still it did not work.
What is the solution for this.
Reply With Quote
  #2 (permalink)  
Old 06-15-04, 11:23
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
What datatype is ENROLLEE_STATE.ENROLLEE_ID?

Andy
Reply With Quote
  #3 (permalink)  
Old 06-15-04, 11:30
prithvi_raj prithvi_raj is offline
Registered User
 
Join Date: Apr 2004
Posts: 36
It's typed type ID . which is of type integer
Reply With Quote
  #4 (permalink)  
Old 06-15-04, 11:49
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
What is the schema of the UDT ID?

Andy
Reply With Quote
  #5 (permalink)  
Old 06-15-04, 13:53
prithvi_raj prithvi_raj is offline
Registered User
 
Join Date: Apr 2004
Posts: 36
The schema is inst01
Reply With Quote
  #6 (permalink)  
Old 06-15-04, 13:58
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
When you create a UDT, the cast functions that are generated are in the same schema as the type. so you need to execute you SQL like this:

SELECT * FROM ENROLLEE_STATE WHERE inst01.INTEGER(ENROLLEE_ID)=?

HTH

Andy
Reply With Quote
  #7 (permalink)  
Old 06-15-04, 23:32
prithvi_raj prithvi_raj is offline
Registered User
 
Join Date: Apr 2004
Posts: 36
My queries are like this...

SELECT * FROM case WHERE INTEGER(case_id) = ?
and
SELECT * FROM enrollee_state WHERE INTEGER(enrollee_id) = ?


And the error i am getting is

COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/SUN] SQL0440N No
authorized routine named "INTEGER" of type "FUNCTION" having compatible
arguments was found. SQLSTATE=42884


I gave the rights by using the following stmt.

grant execute on function integer(enrollee_id) to inst01;

I thought it will work. But not.
Reply With Quote
  #8 (permalink)  
Old 06-16-04, 08:12
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Your problem is that you are using a UDT. When you create a UDT, DB2 will automatically create the casting functions to the base datatype (integer if your example). These functions are in the same schema as the UDT, so to use them you need to fully qualify the function. Unfully qualified functions are searched in the "PATH" which, by default, is SYSIBM,SYSFUNC,SYSPROC,<CURRENT USER>.
Change your queries to fully qualify the cast function, like this:

SELECT * FROM case WHERE inst01.INTEGER(case_id) = ?
and
SELECT * FROM enrollee_state WHERE inst01.INTEGER(enrollee_id) = ?

HTH

Andy
Reply With Quote
  #9 (permalink)  
Old 06-16-04, 08:38
prithvi_raj prithvi_raj is offline
Registered User
 
Join Date: Apr 2004
Posts: 36
ARWinner , thanks for the info.

is there any other workaround?
My developer were not interested to change the code.
There are lot of queries like this.

It was working with V7.1 . But failing with V8.1 and FP5
Reply With Quote
  #10 (permalink)  
Old 06-16-04, 08:49
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
The only thing I can think of is to set the path:

SET CURRENT PATH = CURRENT PATH,inst01

HTH

Andy
Reply With Quote
  #11 (permalink)  
Old 06-16-04, 09:12
prithvi_raj prithvi_raj is offline
Registered User
 
Join Date: Apr 2004
Posts: 36
AR ,

can you be little more clear.

Is there any special register like CURRENT PATH .
or Is taht PATH env solaris variable.

thanks
Reply With Quote
  #12 (permalink)  
Old 06-16-04, 09:22
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
It is a special register. That was SQL that I gave you.

Andy
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