UDF Search Precedence
UDFs can be located in any database, so the best practice is to use the fully qualified name of the function, including the containing database, when you invoke any kind of UDF. When a function call is qualified by a database name, Teradata Vantage looks first for the UDF in the specified database.
If you omit the database name, Vantage searches locations to find the UDF using the following order of precedence:
- The path specified by the SET SESSION UDFSEARCHPATH statement, if set. See Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.
- If the UDF implements cast, ordering, or transform functionality for a UDT, search the SYSUDTLIB database.
- Search the default database for a function with the same name and number of parameters as the function call.
- Search the SYSLIB database for a function with the same name and number of parameters as the function call.