Package Name Clause: CREATE FUNCTION and REPLACE FUNCTION (External Form) - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

The Package Name clause specifies an explicit path to a package file that is to be used for this UDF definition. Packages are libraries that can contain UDFs and other functions to be called by a UDF.

A typical package includes a function library and a script that contains all the necessary SQL DDL and DCL statements to create the functions and make them available to users.

A package is a shared object file with a .so extension for Linux systems.

Package files must be distributed to all server nodes.

You cannot specify the package option with any other encoded path string clause, but you can specify it with a function entry point name string (see EXTERNAL NAME Clause: CREATE FUNCTION and REPLACE FUNCTION (External Form)).

To distribute a third-party package to a database node, use their documented installation procedure. If you are installing a package developed by your programming staff, you can use any of the following general procedures:
  • Install the package in a specific directory and then use PCL to distribute it to all nodes.
  • FTP the package from a client system.
  • Use the Teradata-supplied procedure named installsp, which is stored in SYSLIB.

The syntax for this clause is as follows.

SP¡ package_name

The character ¡ represents a user-defined delimiter.

Perform the following procedure for specifying a package file name string.

  1. Begin the clause with the character S to indicate this is a server specification.
  2. Type the character P to indicate this is a package file specification.
  3. Specify an arbitrary delimiter character to separate the P code and the package name specified in the string.
  4. Specify the path and name assigned to the package file on the platform. You must specify the appropriate file extension for the platform operating system.

    The package file extension must be .so for Linux systems.

    The path must name a package that is already installed on the system and that has been distributed to all its nodes.

    You can use either \ or / characters to specify the path for all platforms.

The maximum package path length is 256 characters.