16.20 - C/C++ Function Name - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Advanced SQL Engine
Teradata Database
Release Number
Release Date
April 2020
Content Type
Programming Reference
Publication ID
English (United States)

The name of the function in the C or C++ source code follows the C function naming conventions, with the additional restrictions that it follows Teradata Database object naming rules. For more information about object naming, see Teradata Vantage™ - SQL Fundamentals, B035-1141.

In C++, the function definition must be preceded by extern "C" so that the function name is not converted to a C++ overloaded name. For example:

extern "C" 
void getregion( VARCHAR_LATIN *region, char sqlstate[6])

The function can call any module written in C++.

When you use the CREATE PROCEDURE or REPLACE PROCEDURE statement to install the external stored procedure, you specify the name of the C or C++ function. For more information, see Specifying the C/C++ Function Name.

On Linux, long names can sometimes cause errors when you install an external stored procedure. For more information, see Argument list too long.