In addition to stored procedures, which use SQL control and condition-handling statements, input and output parameters, and local variables to provide applications with a server-based, precompiled procedural interface, Teradata Database supports external stored procedures.
You can write your own external stored procedures in the C or C++ programming language, install them on the database, and then use the SQL CALL statement to call them like other stored procedures. An external stored procedure runs on a PE.
C and C++ external stored procedures can use Call-Level Interface Version 2 (CLIv2, also referred to as CLI) to directly execute SQL statements. C and C++ external procedures that do not use CLIv2 can make a C library call to invoke a stored procedure and execute SQL statements indirectly.
This section uses the term stored procedure to refer to a stored procedure that is written using SQL statements and the term external stored procedure to refer to a stored procedure that is written using C or C++.
For more information on writing external stored procedures in the Java programming language, see Java External Stored Procedures.