Talk About Network

Google





Data Bases > IBM DB2 > Re: UDF ****tab...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 12 Topic 9074 of 9564
Post > Topic >>

Re: UDF ****tability?

by esmith2112 <esmith2112@[EMAIL PROTECTED] > Jul 11, 2008 at 05:34 AM

> 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
 




 12 Posts in Topic:
UDF Portability?
esmith2112 <esmith2112  2008-07-10 05:20:49 
Re: UDF Portability?
Serge Rielau <srielau@  2008-07-10 09:19:39 
Re: UDF Portability?
Udo <udo.weigl@[EMAIL   2008-07-10 07:06:22 
Re: UDF Portability?
esmith2112 <esmith2112  2008-07-10 07:28:43 
Re: UDF Portability?
esmith2112 <esmith2112  2008-07-10 08:31:26 
Re: UDF Portability?
Serge Rielau <srielau@  2008-07-10 13:16:14 
Re: UDF Portability?
"Dave Hughes" &  2008-07-12 15:57:39 
Re: UDF Portability?
Knut Stolze <stolze@[E  2008-07-11 12:41:54 
Re: UDF Portability?
esmith2112 <esmith2112  2008-07-11 05:34:23 
Re: UDF Portability?
Knut Stolze <stolze@[E  2008-07-16 19:32:28 
Re: UDF Portability?
esmith2112 <esmith2112  2008-07-14 13:30:02 
Re: UDF Portability?
esmith2112 <esmith2112  2008-07-15 13:45:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 21:44:09 PST 2009.