Hi All,
With reference to thread 181796, I tried the following UDF
C Source:
SQL_API_RC SQL_API_FN multi ( SQLUDF_INTEGER *in1,
SQLUDF_INTEGER *in2,
SQLUDF_INTEGER *outProduct,
SQLUDF_NULLIND *in1NullInd,
SQLUDF_NULLIND *in2NullInd,
SQLUDF_NULLIND *productNullInd,
SQLUDF_TRAIL_ARGS )
{
*outProduct = (*in1) * (*in2);
return (0);
}
Create statement:
create function multi(in1 integer, in2 integer)
returns integer
language c
parameter style sql
no sql
fenced threadsafe
deterministic
returns null on null input
no external action
external name '<path>multi!multi'
But when i try to run it, it always returns 0:
select multi(1,2) from sysibm.sysdummy1
1
-----------
0
Can someone plz help. Is the problem related to compilation?