Example: Distributing a Package - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantageā„¢

Here is an example of how to distribute version 1.0 of a package called libcstd2.so to all nodes. In this example, the target server directory is /Teradata/dem/udfs and there is an .so file on the Windows client:

LobTeq -- Enter your DBC/SQL request or LobTeq command:
.using 'libcstd2.so'xfile

*** .using accepted

LobTeq -- Enter your DBC/SQL request or LobTeq command:
USING (a BLOB AS DEFERRED)
CALL SYSLIB.installsp('cstdlib2', '1.0', 'libcstd2.so', 'udfs',
   :a, 'CREATE', pform, cfgpath);

Sending LOB data, chunk 1
*** Procedure has been executed.

LINUX64               /Teradata/dem/udfs/

Here is an example of a CREATE FUNCTION statement that creates the function from the installed package.

CREATE FUNCTION SYSLIB.cSTD_DEV(x FLOAT)
RETURNS FLOAT
CLASS AGGREGATE
LANGUAGE C
NO SQL
PARAMETER STYLE SQL
EXTERNAL NAME 'SP!/Teradata/dem/udfs/libcstd2.so';

Note that the filename and path specified in the EXTERNAL NAME clause are the same as the filename IN argument and cfgpath OUT argument in the call to installsp.