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 SQLSSTATE = 42884 when creating and deploying Java UDF

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-09-06, 23:35
tintin06 tintin06 is offline
Registered User
 
Join Date: May 2006
Posts: 2
Getting SQLSSTATE = 42884 when creating and deploying Java UDF

I am a new bee and am trying out Java UDFs in UDB for the first time.
If anyone has implemented Java UDFs via Jars , could you please help ?

1) To start with, I'm taking sample files from /sqllib/java/jdbc viz., UDFjCreate.db2, UDFjsrv.java and Util.java into my local dir in solaris.
2) After compiling the java files with version 1.3.1 , jarred them
3) Used SQLJ.INSTALL_JAR sproc and gave the jar id "javaudf"
4) Also loaded file UDFjCreate.db2 into the database
5) I do see that the jar by name javaudf.jar gets created under /sqllib/function/jar/TEST/javaudf.jar (NOTE: My schema is TEST. And hence the location)
6) I also see that the function defined shows up in syscat.functions catalog table
7) But get the error below when calling the UDF from the command prompt (I do make this call when the current schema is TEST)

SQL0440N No authorized routine by name "SCALARUDF" of type FUNCTION with compatible arguments was found. SQLSTATE = 42884

CAN SOMEONE PLEASE SUGGEST WHAT I COULD BE MISSING HERE ???
Reply With Quote
  #2 (permalink)  
Old 05-10-06, 02:41
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
CURRENT SCHEMA does not work for UDFs ... You will have to set the CURRENT FUNCTION PATH ...
Refer the manuals for the syntax

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 05-10-06, 10:35
tintin06 tintin06 is offline
Registered User
 
Join Date: May 2006
Posts: 2
Thanks ! On setting the PATH , I am refreshingly now getting a different error.
I read thru the documentation, but didn't get what needed to be done.

Note: Am calling the udf with values(TEST.scalarUDF('as')).
I do not need a java client to exec my udf. I should be able to call it using the values clause in SQL.


SQL4306N Java stored procedure or user-defined function "TEST.SCALARUDF",
specific name "SQL060509164910200" could not call Java method "scalarUDF",
signature "(Ljava/lang/StringI". SQLSTATE=42724

CAN SOMEONE SUGGEST,PLEASE?
Reply With Quote
  #4 (permalink)  
Old 05-12-06, 18:13
pjcarreira pjcarreira is offline
Registered User
 
Join Date: Feb 2004
Location: Lisbon, Portugal
Posts: 5
Check the paramter passing protocol

How is your UDF declared in SQL-PL and in Java?

Are you sure you have the correct Java declaration for the paramerter style you are using? (DB2GENERAL vs Java)

This should work if you use Java parameter style
public static java.lang.String scalarUDF(final java.lang.String in)
{
// do stuff
return in;
}

See if this helps: http://www-128.ibm.com/developerwork...le/dm-0510law/
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