Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    2

    Unanswered: 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 ???

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

  3. #3
    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?

  4. #4
    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/

Posting Permissions

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