16.20 - UDF Locations - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)

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

When you omit the database name, Teradata Database searches for the UDF in the following order:

  1. 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, Teradata Database 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.
  2. 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, Teradata Database 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.
  3. 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, Teradata Database 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.