16.20 - savepkg Stored Procedure - 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)

Purpose

Use the savepkg stored procedure to back up a specific version of a package and the associated DDL statements that install the package, storing the information in the demddl and dempart system tables.

Definition

REPLACE PROCEDURE savepkg
   (IN  U_Name      VARCHAR(30),
    IN  U_Version   VARCHAR(30),
    IN  U_Database  VARCHAR(30),
    IN  U_DemT      VARCHAR(30),
    IN  U_Create    CLOB,
    IN  U_DemFN     VARCHAR(30),
    IN  U_Content   BLOB,
    OUT out1        VARCHAR(30)
   )

where:

U_Name
Name of the package.
Teradata Database stores the name of the package in the demddl and dempart system tables in the SYSLIB database.
U_Version
Version of the package.
Teradata Database stores the version number that you assign to the package in the demddl and dempart system tables in the SYSLIB database.
U_Database
Database in which the package is installed.
Teradata Database stores the name of the database in which you installed the package in the demddl and dempart system tables in the SYSLIB database.
U_DemT
Value that you assign to describe the type of package or package component.
Teradata Database stores the value that you provide in the demddl system table in the SYSLIB database.
For example, if you are using savepkg to back up a UDF package, you might want to use the value 'UP'. If you are using savepkg to back up UDF package components, you might want to use 'US' for UDF source, 'UI' for UDF include files, and 'UO' for UDF objects.
U_Create
DDL statement that installs the package on the server.
If the DDL statement is in a file, you can use a USING variable name preceded by a COLON character. During processing, savepkg replaces U_Create with the contents of the file.
If the DDL statement specifies an EXTERNAL NAME clause with multiple parts, for example a C language source file and a C language include file, you must call savepkg for each part, but you only need to pass the DDL statement in the first call. In each subsequent call, you can pass 'NULL' for the U_Create argument.
Teradata Database stores the statement in the demddl system table in the SYSLIB database.
U_DemFN
Filename of the package.
U_Content
USING variable name preceded by a COLON character.
When you call savepkg to back up a package, the CALL statement that you use must specify a USING row descriptor. During processing, savepkg replaces U_Content with the contents of the package.
out1
Return status.