The required external body reference clause declares that the function is external to Vantage and identifies the location of all the file components it needs to be able to run.
An external function name is optional. When it is specified, it must be the name of the C or C++ source code file on the client system to be retrieved and compiled as part of the CREATE FUNCTION or REPLACE FUNCTION process.
If the external function name alone is not sufficient to specify the location of all the function components, you must specify a string literal that explicitly specifies the path to each of those elements. See External String Literal.
In all cases, function_name is the identifier you specify when you invoke the function from SQL statements.
- External function name
- Parameter style
The following table summarizes the options you can specify in this clause.
IF CREATE FUNCTION specifies this clause … | THEN … |
---|---|
EXTERNAL |
If the client is mainframe-attached, then the C or C++ function name must be the DDNAME for the source. |
EXTERNAL NAME external_function_name | the C or C++ function name must match function_name. If the client is mainframe-attached, then function_name must be the DDNAME for the source. |
EXTERNAL NAME 'string' | 'string' can specify the C or C++ function name by stipulating the F option with a function_entry_name, which must match the name of the C or C++ function. The maximum length of 'string' is 1,000 characters. You cannot specify the F option in ‘string'without also specifying an include, library, object, package, or source file name. Vantage needs one or more of these file names to link to. If 'string' does not stipulate a function_entry_name, then the following rules apply to the C or C++ function name.
|
For more information, see Teradata Vantage™ - SQL External Routine Programming, B035-1147.
Note that 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 for more information.