17.10 - Package Name Clause - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1184-171K
Language
English (United States)

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 as well as 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).

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.

    For instructions on how to use installsp, see Teradata Vantage™ - SQL External Routine Programming, B035-1147.

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.