Hello!
My function have only one input parameter(varchar) and should return a table with 3 columns(varchar, varchar, integer).
I have a problem with my function:
"SQL0390N The function "DB2INS79.EMPLOYEES_OF" resolved to specific function "SQL091127145329200" that is not valid in the context where it is used."
I have checked my function, but I didn't find some mistakes..
CREATE FUNCTION EMPLOYEES_OF(DEPTNO VARCHAR(20))
RETURNS TABLE(FIRSTNAME VARCHAR(12),LASTNAME VARCHAR(15),YEARS INTEGER)
LANGUAGE JAVA
EXTERNAL NAME 'TableFunc!outTable'
PARAMETER STYLE DB2GENERAL
.....@
...public class TableFunc extends UDF
{ ...
public void outTable(String Deptno, String FIRSTNAME, String LASTNAME, int Years) throws Exception
{
switch (getCallType())
{ ...
case SQLUDF_TF_FETCH:
if (!rs.next())
{
setSQLstate("02000");
}else{
set(2, rs.getString("FIRSTNME"));
set(3, rs.getString("LASTNAME"));
set(4, rs.getInt("YEARS"));
}
break;
...
}
}
}