C/C++ Function Name | External Stored Procedures | Teradata Vantage - C/C++ Function Name - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantageā„¢

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 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.