Calling an Overloaded Function | Teradata Vantage - Calling an Overloaded Function - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantageā„¢

If several functions have the same name, then Vantage uses the following steps to determine which function to invoke.

IF... THEN...
no argument in the function call is the NULL keyword if one of the functions has parameter types that are identical to the corresponding argument types of the function call, then Vantage selects that function.
If no function has parameter types that are identical to the corresponding argument types of the function call, then Vantage repeats the following test for each argument of the function call, starting with the first (left):
  • If the argument type of the function call fits the corresponding parameter type of any of the functions, in order of compatibility precedence, then keep those functions and eliminate the others.
  • If the argument type of the function call does not fit the corresponding parameter type of any of the functions, in order of compatibility precedence, then return an error.

For more information on the rules of compatible precedence, see Compatible Types.

any argument in the function call is the NULL keyword Vantage repeats the following test for each argument of the function call, starting with the first (left):
  • If the argument type of the function call fits the corresponding parameter type of any of the functions, in order of compatibility precedence, then keep those functions and eliminate the others.
  • If the argument is the NULL keyword, then treat the NULL as a wildcard that matches any data type and continue to the next argument. Do not eliminate any function.
  • If the argument type of the function call does not fit the corresponding parameter type of any of the functions, in order of compatibility precedence, return an error.
After testing each argument and not returning an error, Vantage uses the following rules:
  • If one function remains, then Vantage selects that function.
  • If more than one function remains, then the system returns an error.

    To avoid this error, you can explicitly cast the keyword NULL to the data type of the corresponding parameter of the overloaded UDF you want to use.

For more information on the rules of compatible precedence, see Compatible Types.