UDF Locations | SQL External Routine Programming | Teradata Vantage - 17.10 - UDF Locations - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
English (United States)

When a function call is qualified by a database name, Vantage looks for the UDF in the specified database only.

If you omit the database name, Vantage searches for the UDF in the following order:

  1. The path specified by the SET SESSION UDFSEARCHPATH statement, if set. See Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.
  2. If the UDF implements cast, ordering, or transform functionality for a UDT, search the SYSUDTLIB database.
    IF such a function … THEN …
    exists, and the arguments in the function call are compatible with the function parameters and follow the order of precedence the search stops.

    If several functions exist, Vantage must decide which function is the best fit. For details, see Calling a Function That is Overloaded.

    does not exist, or the arguments in the function call are not compatible with the function parameters the statement returns an error.
  3. Search the default database for a function with the same name and number of parameters as the function call.
    IF such a function … THEN …
    exists, and the arguments in the function call are compatible with the function parameters and follow the order of precedence the search stops.

    If the database has several functions with the same name, Vantage must decide which function is the best fit. For details, see Calling a Function That is Overloaded.

    does not exist, or the arguments in the function call are not compatible with the function parameters the search continues.
  4. Search the SYSLIB database for a function with the same name and number of parameters as the function call.
    IF such a function … THEN …
    exists, and the arguments in the function call are compatible with the function parameters and follow the order of precedence the search stops.

    If several functions exist, Vantage must decide which function is the best fit. For details, see Calling a Function That is Overloaded.

    does not exist, or the arguments in the function call are not compatible with the function parameters the statement returns an error.

For the rules of compatibility precedence, see Compatible Types.