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

Basic Teradata® Query Reference - 20.00

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Basic Teradata Query
Release Number
20.00
Published
October 2023
ft:locale
en-US
ft:lastEdition
2025-04-02
dita:mapPath
gxl1691484661681.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
psp1479308573013
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.