Downloads

Featured downloads

Recently published downloads

Great Circle Distance Calculation UDF

Version: 1.0 - Created: 12 Jun 2008

This UDF implements the great circle distance algorithm to determine the distance in miles between two points expressed in longitude and latitude. This distribution contains full source code, REPLACE FUNCTION SQL, a test suite and documentation.

MD5 Message Digest UDF

Version: 1.0 - Created: 12 Jun 2008

This UDF implements the MD5 message-digest algorithm. The algorithm takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input (RFC1321). This distribution contains full source code, a test suite, scripts, and documentation. README MD5 UDF package for Teradata Version 2.0 (2008-05-08) 1. Summary This package includes a UDF that generates MD5 message digest. For MD5 itself, refer RFC1321[1]. 2. Syntax hash_md5(varchar) This function takes one char/varchar argument of arbitary length and always returns 128-bit hash value as hexadecimal char(32) format. It does not accept NULL value. The name of the UDF is changed from there is an incompatibility against previous release. (see 4. History) 3. Installation 1 unpack the archive and go to src directory 2 start bteq and login to teradata 3 .run file = hash_md5.btq 4 if you would like to validate hash value generated by the UDF, run md5test_cre.sql, md5test_ins.sql and md5test_chck.sql in the test directory You can edit md5.h to customize hash generation. UDF_MD5_UPPERCASE: if set to 1 (default), generate MD5 result in upper case UDF_MD5_COMPAT: if set to 1 (not default), generate same result as previous release (see 4. History) 4. History Fixed MD5 algorithm that generates wrong result when the input length is 54 + 64*N bytes (N>= 0). Removed malloc() function which may cause memory problem in UDF. Fixed compilation issues on Windows platform. 5. Caveat You should not use these function to encrypt password without 'salt'. 6. Author KURODA Akira <akira.kuroda@teradata.com> Teradata Japan A. Rererences [1] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, April 1992. B. Example hash_md5('') -> d41d8cd98f00b204e9800998ecf8427e hash_md5('a') -> 0cc175b9c0f1b6a831c399e269772661 hash_md5('abc') -> 900150983cd24fb0d6963f7d28e17f72 hash_md5('message digest') -> f96b697d7cb7938d525a2f31aaf161d0 hash_md5('message digest') -> f96b697d7cb7938d525a2f31aaf161d0 hash_md5('abcdefghijklmnopqrstuvwxyz') -> c3fcd3d76192e4007dfb496cca67e13b hash_md5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') -> d174ab98d277d9f5a5611c2c9f419d9f hash_md5('123456789012345678901234567890123456789012345678901234567890123456 78901234567890') -> 57edf4a22be3c955ac49da2e2107b67a

UDF Packaging for Teradata 12.0

Version: 1.0 - Created: 02 Mar 2008

The self extractable file includes the lobload application to load UDF's, SP's etc. into Teradata as part of installation.

Sample UDFs for String Searching

Version: 1.0 - Created: 11 Sep 2007

Eight UDFs that search VARCHAR and CLOB string sources to see if they contain VARCHAR or CLOB string sets. Four of the UDFs are overloaded (named the same) to return the result in the form of VARCHAR or CLOB string while the other four UDFs are overloaded to return an INTEGER index into the string source if a match is found.

Edit Distance and N-Gram string UDFs

Version: 1.0 - Created: 27 Jan 2005

This package contains two string-related UDFs. The Edit Distance function returns the minimum number of edit operations required to transform string1 into string2. The N-Gram matching function returns the number of n-gram matches between two strings.