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:
- 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 Result Action Function exists, and arguments in function call are compatible with function parameters and follow order of precedence. Search stops. If database has multiple functions with same name, Vantage decides which function is best fit. See Calling an Overloaded Function.
Function does not exist, or arguments in function call are incompatible with function parameters. Statement returns error. - Search the default database for a function with the same name and number of parameters as the function call.
Search Result Action Function exists, and arguments in function call are compatible with function parameters and follow order of precedence. Search stops. If database has multiple functions with same name, Vantage decides which function is best fit. See Calling an Overloaded Function.
Function does not exist, or arguments in function call are incompatible with function parameters. Search continues. - Search the SYSLIB database for a function with the same name and number of parameters as the function call.
Search Result Action Function exists, and arguments in function call are compatible with function parameters and follow order of precedence. Search stops. If database has multiple functions with same name, Vantage decides which function is best fit. See Calling an Overloaded Function.
Function does not exist, or arguments in function call are incompatible with function parameters. Statement returns error.
For the rules of compatibility precedence, see Compatible Types.