External Body Reference Clause: CREATE FUNCTION and REPLACE FUNCTION (External Form) - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

The required external body reference clause declares that the function is external to Vantage and identifies the location of the file components it must be able to run.

The optional external function name must be the name of the C or C++ source code file on the client system to retrieve and compile as part of the CREATE FUNCTION or REPLACE FUNCTION process.

If the external function name is not sufficient to specify the location of all the function components, you must specify (as a string literal) the path to each element. See External String Literal: CREATE FUNCTION and REPLACE FUNCTION (External Form).

Specify function_name to invoke the function from a SQL statement.

You can optionally specify either or both of the following options for this clause:
  • External function name
  • Parameter style
For ways to specify an external function name, see the following:

The following table summarizes the options you can specify in this clause.

Clause Result
EXTERNAL If you specify the SPECIFIC clause, the C or C++ function name must match specific_function_name. Otherwise, the C or C++ function name must match function_name.

If client is mainframe-attached, C or C++ function name must be DDNAME for source.

EXTERNAL NAME external_function_name C or C++ function name must match function_name.

If client is mainframe-attached, C or C++ function name must be DDNAME for source.

EXTERNAL NAME 'string' string can specify C or C++ function name using F option with function_entry_name, which must match name of C or C++ function.

Maximum length of string is 1,000 characters.

If you specify F option in string, you must also specify include, library, object, package, or source file name.

If string does not specify function_entry_name: If you specify the SPECIFIC clause, the C or C++ function name must match specific_function_name. Otherwise, the C or C++ function name must match function_name.

These specifications cannot be used for Java external procedures.

You can specify the parameter style for the function either in this clause or in the Optional Function Characteristics clause, but you can only specify the parameter style for a function one time in its definition. See "Parameter Style Clause" in Using Clauses: CREATE FUNCTION and REPLACE FUNCTION (External Form).