469,951 Members | 2,352 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

problem with udf

i have a class file like this ,

import java.sql.*;
public class JAVA_UDF {

/*
public static void main(String args[])throws Exception{
JAVA_UDF obj=new JAVA_UDF();
System.out.println("Result "+obj.test3());
}
*/
public static String test10()throws SQLException {
return "my java udf has been invoked";
}

}

,

and i am calling a method through udf,

CREATE FUNCTION SRIDHAR_S.TEST10 ( )
RETURNS VARCHAR(50)
LANGUAGE java
PARAMETER STYLE java
NO SQL
FENCED
THREADSAFE
DETERMINISTIC
RETURNS NULL ON NULL INPUT
NO EXTERNAL ACTION
EXTERNAL NAME 'JAVA_UDF!test10' ,
select sridhar_s.test10() from sysibm.sysdummy1 i am getting the
fallowing error
SQL0430N User defined function "SRIDHAR_S.TEST10" (specific name
"SQL061025114355600") has abnormally terminated. SQLSTATE=38503

i put the class file in function directory, is i'm missing anything

plz help.

thanks and regards

sri

Oct 25 '06 #1
2 1789
What is your db2 version, fixpack, platform?
What is in your db2diag.log file after calling this function?
I've tried your example and it works fine.
Sincerely,
Mark B.
i have a class file like this ,

import java.sql.*;
public class JAVA_UDF {

/*
public static void main(String args[])throws Exception{
JAVA_UDF obj=new JAVA_UDF();
System.out.println("Result "+obj.test3());
}
*/
public static String test10()throws SQLException {
return "my java udf has been invoked";
}

}

,

and i am calling a method through udf,

CREATE FUNCTION SRIDHAR_S.TEST10 ( )
RETURNS VARCHAR(50)
LANGUAGE java
PARAMETER STYLE java
NO SQL
FENCED
THREADSAFE
DETERMINISTIC
RETURNS NULL ON NULL INPUT
NO EXTERNAL ACTION
EXTERNAL NAME 'JAVA_UDF!test10' ,
select sridhar_s.test10() from sysibm.sysdummy1 i am getting the
fallowing error
SQL0430N User defined function "SRIDHAR_S.TEST10" (specific name
"SQL061025114355600") has abnormally terminated. SQLSTATE=38503

i put the class file in function directory, is i'm missing anything

plz help.

thanks and regards

sri
Oct 25 '06 #2
situ wrote:
i have a class file like this ,

import java.sql.*;
public class JAVA_UDF {

/*
public static void main(String args[])throws Exception{
JAVA_UDF obj=new JAVA_UDF();
System.out.println("Result "+obj.test3());
}
*/
public static String test10()throws SQLException {
return "my java udf has been invoked";
}

}

,

and i am calling a method through udf,

CREATE FUNCTION SRIDHAR_S.TEST10 ( )
RETURNS VARCHAR(50)
LANGUAGE java
PARAMETER STYLE java
NO SQL
FENCED
THREADSAFE
DETERMINISTIC
RETURNS NULL ON NULL INPUT
NO EXTERNAL ACTION
EXTERNAL NAME 'JAVA_UDF!test10' ,
select sridhar_s.test10() from sysibm.sysdummy1 i am getting the
fallowing error
SQL0430N User defined function "SRIDHAR_S.TEST10" (specific name
"SQL061025114355600") has abnormally terminated. SQLSTATE=38503

i put the class file in function directory, is i'm missing anything
SQL0430 means that the UDF crashed. Your function looks fine to me. My
guess is that you may run an incompatible Java version (incompatible with
DB2) and the JVM goes into the Nirvana.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Oct 25 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Kostatus | last post: by
117 posts views Thread by Peter Olcott | last post: by
18 posts views Thread by Ian Stanley | last post: by
28 posts views Thread by Jon Davis | last post: by
6 posts views Thread by Ammar | last post: by
2 posts views Thread by Mike Collins | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.