External Stored Procedures - Basic Teradata Query

Basic Teradata Query Reference

Product
Basic Teradata Query
Release Number
16.20
Published
October 2018
Language
English (United States)
Last Update
2020-02-20
dita:mapPath
kil1527114222313.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

An external stored procedure is defined with a CREATE PROCEDURE or REPLACE PROCEDURE statement, along with EXTERNAL references for source files.

For example:

CREATE PROCEDURE xyz
(IN data1 INTEGER, OUT data2 INTEGER)
LANGUAGE CPP NO SQL PARAMETER STYLE TD_GENERAL
EXTERNAL NAME 'CS!xyz!source.cpp';

The C or C++ files can reside on the server or the client. The server calls for the transfer of client-resident files as needed to satisfy input requirements for the CREATE PROCEDURE or REPLACE PROCEDURE request. Source files must be encoded as ASCII (workstation) or EBCDIC (mainframe), regardless of the current session character set. See SQL External Routine Programming (B035-1147) for more information.

The retrieval of client-resident external stored procedure files is handled the same way that User-Defined Function files are handled. See Specifying Files for User-Defined Functions.