a***@it.ibm.com
2007-08-17 12:46:23 UTC
Need help in creating JAVA UDF
Hi all,
I'm newbie on java programming.
I'm trying to develop a JAVA UDF that returns the n-1 value (the previous) passed to it, I think that using SCRATCHPAD is a good idea.
Here is my java code for a UDF that simply returns the integer value you pass it:
CREATE FUNCTION testIt(INTEGER) RETURNS INTEGER
EXTERNAL NAME 'ACFTestFunc!testIt'
not fenced
language java
parameter style db2general
no sql
scratchpad
no external action
import java.sql.*;
class ACFTestFunc extends COM.ibm.db2.app.UDF
{
public void testIt(int inValue, int result)
throws Exception
{
set(2,inValue);
}
}
Someone colud help me to modify this code ?
Thanks a lot
Ciao
Alessandro
Hi all,
I'm newbie on java programming.
I'm trying to develop a JAVA UDF that returns the n-1 value (the previous) passed to it, I think that using SCRATCHPAD is a good idea.
Here is my java code for a UDF that simply returns the integer value you pass it:
CREATE FUNCTION testIt(INTEGER) RETURNS INTEGER
EXTERNAL NAME 'ACFTestFunc!testIt'
not fenced
language java
parameter style db2general
no sql
scratchpad
no external action
import java.sql.*;
class ACFTestFunc extends COM.ibm.db2.app.UDF
{
public void testIt(int inValue, int result)
throws Exception
{
set(2,inValue);
}
}
Someone colud help me to modify this code ?
Thanks a lot
Ciao
Alessandro