savepkg Stored Procedure - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

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.