Use of External Stored Procedures in BTEQ | Basic Teradata Query - External Stored Procedures - Basic Teradata Query

Basic Teradata® Query Reference

Product
Basic Teradata Query
Release Number
17.10
Published
February 2022
Language
English (United States)
Last Update
2022-02-03
dita:mapPath
nnw1608578382132.ditamap
dita:ditavalPath
obe1474387269547.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 Teradata Vantage™ - 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.