Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sun, 04 Jun 2012 @ 00:56:43 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: How to Deploy UDF in Teradata
 
From:   McCall, Glenn David

Refer to the Create Function section of the SQL Reference manual. The DDL manual is a good start.

Also check the developer exchange http://developer.teradata.com/

Here is an example that creates a C udf:

     create function adder (
             x Integer,
             y Integer
         )
         returns Integer
     language c
     no sql
         parameter style sql
     external name 'CS!add!add.c!F!udfAdd'
     ;

The above example creates a function called "adder" it takes two parameters x & y both of which are integers. The source code is in a file called "add.c" and the entry point is udfAdd.

*******************
*******************
** Important Note **
*******************
*******************

The create function sql is **VERY** closely tied to the way that the udf code is written. For example, you can't just decide to add a third parameter (e.g. Z) without changing the code in "add.c".

Therefore, the UDF's you have been given to deploy ****should*** come with a corresponding create function query.


Hope this helps

Glenn Mc



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023