> Could you show us the source code of the function entry point of your
UDF?
>
> --
> Knut Stolze
> Data Warehousing for DB2 z/OS
> IBM Germane Research & Development
For an additional test, I replaced the SQL interface with a
traditional main(), compiled it, FTP'ed it and executed it on the
target machine. It works as expected.
Source is below. Templated from routine Serge posted some time back.
void SQL_API_FN hash(SQLUDF_VARCHAR *str,
SQLUDF_VARCHAR *outHash,
SQLUDF_SMALLINT *strNullInd,
SQLUDF_SMALLINT *outHashNullInd,
SQLUDF_TRAIL_ARGS)
{
int i;
unsigned char hash_str[40];
if (*strNullInd == -1)
{
*outHashNullInd = -1;
}
else
{
i = strlen(str);
my_hash((unsigned char *) str, i, hash_str);
sprintf(outHash, "%X", hash_str);
*outHashNullInd = 0;
}
}
Evan


|