Refer to the orange book of UDF (search Teradata database user defined function User's guide)
section 2.2.3.3 Registration process for Packages.
You can compile your code to .so (sahred library) on the server node first (refer to gcc / make how to compile a so), and then put it under a specific path which exists in system PATH variable (using put to push the file to all nodes) .
then you can use the SP (server package) to deploy DDLs.
Here is a DDL sample provided in the orange book
CREATE FUNCTION udfSubStr(
strexpVARCHAR(512),
n1INTEGER,
n2INTEGER
)RETURNS VARCHAR(512)
LANGUAGE C
NO SQL
SPECIFIC udf_substr3
EXTERNAL NAME 'SP!/home/udfs/substr.so'
PARAMETER STYLE SQL;
↧