16.20 - Example: Backing Up a Package - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)

Here is an example of how to back up version 1.0 of a package called libcstd2.so and its associated CREATE statement that installs the package on the Teradata server.

lobteq << EOF

.logon slugger/adm455,sn6Y24

.using 'cstdlib2_DDL.txt'xfile 'libcstd2.so'xfile
USING (a CLOB AS DEFERRED, b CLOB AS DEFERRED)
CALL SYSLIB.savepkg('cstdlib2','1.0','SYSLIB','UP', :a,
   'libcstd2.so', :b, out1);

EOF

The CREATE statement in the cstdlib2_DDL.txt file looks something like this:

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';