Hi,
In http://www.teradataforum.com/
is huge amount of Tips and examples.
eg.http://www.teradataforum.com/is_integer.htm
greetings
stami
Hi,
about the syntax above of the EXTERNAL:
here is a exampel for header file and src file for an
installation on the server:
EXTERNAL NAME 'SI!to_number!/my/home/udf/to_number.h!SS!to_number!/ my/home/udf/to_number.c'
stami
Hi the above from me was for unix.
In TD the User Rights create alter and exec functions are nessesary.
Here is the description for W2K found in UDF-Orange book:
Full path specified to W2K server source
CREATE FUNCTION udfSubStr(
strexp VARCHAR(512),
n1 INTEGER,
n2 INTEGER
)RETURNS VARCHAR(512)
LANGUAGE C
NO SQL
EXTERNAL NAME 'SS!sname!c:\program files\ncr\tdat\tdconfig\teradata\tdbs_udf\usr\ udf_substr.c!F!udf_substr3'
PARAMETER STYLE SQL;
File is located on the server S and the file type is S source.
The separator character is ! and the name of the server file is sname.
The full path to the file is specified.
The C function name in the file udf_substr3.c is speci-fied
using the function entry option F, udf_substr3.
The specific name defaults to the function name, udfsubstr.
For sname I take the same function name as in the CREATE FUNCTION Clausel
Greetings stami

Hello,
Please give me an example. How to write a UDF.
I have the C language function written. I also have the teradata database and the C compiler on the same machine.
What is the default path on the Teradata Server?
CREATE FUNCTION MYDB.func_a (vara INT)
RETURNS INT
CLASS SCALAR
LANGUAGE C
NO SQL
PARAMETER STYLE SQL
EXTERNAL NAME 'CI!stdio.h' 'CI!conio.h' 'CS!helloworld.c' 'F!main';
Is the above syntax correct? How am I supposed to write the path of the header and the source files?
Please look at the EXTERNAL statement particularly
Thanks,
Nidhi