15.00 - About Installing and Registering External Language Scripts - Teradata Database

Teradata Database SQL Functions, Operators, Expressions, and Predicates

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1145-015K
Language
English (United States)

About Installing and Registering External Language Scripts

External language scripts can be installed, replaced, removed and redistributed to all nodes by using the following external stored procedures.

SYSUIF.INSTALL_FILE

Use SYSUIF.INSTALL_FILE to register the external language script and install the script on all nodes.

The SYSUIF.INSTALL_FILE external stored procedure has this definition:

   SYSUIF.INSTALL_FILE(
       IN uif_name VARCHAR(128)NOT CASESPECIFIC CHARACTER SET UNICODE,
       IN uif_filename  VARCHAR(256) CASESPECIFIC CHARACTER SET UNICODE,
       IN locspec  VARCHAR(1024)CASESPECIFIC CHARACTER SET UNICODE,
       );

where:

 

Argument …

Specifies …

uif_name

the SQL name associated with the user-installed file. It cannot have a database name associated with it, as the file is always installed in the current database.

The uif_name should be unique within a database.

The uif_name can be any valid Teradata identifier.

uif_filename

the name of the file and the extension (if any) to register. The uif_filename can be any valid LINUX file name.

Use the uif_filename while executing the file using the SCRIPT table operator.

The max length of uif_filename is 255 characters.

locspec

the location of the script file to register.

The first two characters of the locspec string specify whether the external language script is on the client or on the database server. If the first two characters are...

  • C, then the script is on the client.
  • S, then the script is on the database server.
  • The third character of the locspec string is a delimiter that you choose to separate the first two characters from the remaining characters in the locspec string. The delimiter is a single character.

    The file_type is 'Z' text file or 'B' binary file.

    The remaining characters in the locspec string specify the file path.

    If the file is on the..

  • client, then the file path is a client-interpreted path that specifies the location and name of the file.
  • database server, then the file path is a full or relative path specifying the location and name of the file.
  • If the file path is relative, the full path to the archive file is formed by appending the relative path to the default path for source code on the server.

    To determine the default path for source code, use the ‑o option of the cufconfig utility and find the setting for the SourceDirectoryPath field:

         cufconfig -o

    For information on cufconfig, see Utilities: Volume 1 (A-K).

    Examples  

    The following statement calls SYSUIF.INSTALL_FILE to install a Python script and distribute the file to all nodes:

      CALL SYSUIF.INSTALL_FILE('mapper', 'mapper.py',
      'cz!mapper.py!/tmp/mapper.py');

    Related Topics

    For details on administering external stored procedures, see the Administration chapter in SQL External Routine Programming.