Downloads

Featured downloads

Recently published downloads

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.

Is_numeric() UDF

Version: 1.0 - Created: 27 Jan 2005

Is_numeric() UDF checks a field to see if it converts to a Teradata numeric value. one use would be for the ETL process to use the UDF to check incoming data that's destined for DECIMAL and INTEGER columns.

WebSphere MQ Client UDF

Version: 1.0 - Created: 17 Jan 2005

SQL Scalar UDF that writes varbyte or varchar arg to MQ. README Purpose: SQL Scalar UDF that writes varbyte or varchar arg to MQ Author: Robert Hahn Robert.Hahn@teradata.com Support: Author will answer questions and consider enhancment requests on a time available basis. email: Robert.Hahn@ncr.com with any questions, suggestions, or feedback. Contents: Parms: qmgr, qnm, channel, varchar message. Comments--To Do: Add varbyte overload. Accept identity args and open w/MQOO_ALTERNATE_USER_AUTHORITY for varchar, set md.Encoding and md.CodedCharSetId so that mq will convert e.g. to ebcdic Use snprintf, strncpy (had some problem with snprintf). Documentation: MQConnect/MQOpen then MQPUT the varchar argument. This can be used for single puts or parallel controlled by a where clause. This should be run in protected mode since it causes mallocs. Note: Update defaults for qmgr, qnm, envmq etc. Requirements: For MPRAS, this requires that the IBM MQ Client for MPRAS is installed on all nodes: Obtain from here: http: www-1.ibm.com/support/docview.wss?uid=swg24000067 Similar for windows--available as part of any Websphere MQ Server distribution Build: Scalar UDF: replace function emruwmq( qmgr varchar(256), qnm varchar(256), channel varchar(256), vcmsg varchar(32000)) returns integer language C NO SQL parameter style sql EXTERNAL NAME 'F:emruwmq:SI:cmqc:/usr/include/cmqc.h:SL:mqic:SL:mqmcs:SS:emruwmq:/home/rmh/projects/emruwmq/emruwmq.c'; select emruwmq('queue.manager.1','QUEUE1','CHANNEL1/TCP/153.64.119.177','themessage') [from allamp where ampid <= 8 ] /* parallel--assumes allamp table with 1 row/amp */ Invoking from an insert statement trigger on table cxpmult w/varchar col2: replace TRIGGER writeMq after Insert on cxpmult REFERENCING NEW table AS n FOR EACH statement (INSERT INTO dummy sel emruwmq('queue.manager.1','QUEUE1','CHANNEL1/TCP/153.64.119.177',n.col2) as c1 from n where c1 < 0;);

In-place compression UDF

Version: 1.0 - Created: 22 Jun 2004

In-place compression UDF. Compress column value for VARCHARs and BLOBS. Similar to zipping the column before inserting. Can also be used for encrypting data in the database. After compression data is unreadable until uncompressed.  

Teradata UDFs for popular IBM DB2 functions

Version: 1.0 - Created: 22 Jun 2004

Teradata UDFs for popular IBM DB2 functions.  

Byte Operation UDFs

Version: 1.0 - Created: 22 Jun 2004

UDFs for Byte operations, such as bitwise AND, OR, XOR, NOT, SHIFT, and conversion of a byte value to character.