Examples | Function Selection | Teradata Vantage - Example: Function Selection for Numeric Types - 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
ft:locale
en-US
ft:lastEdition
2025-03-30
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
qnu1472247494689
lifecycle
latest
Product Category
Teradata Vantageā„¢

Consider the following Sales functions and the corresponding specific name as specified in the SPECIFIC clause of the CREATE FUNCTION statement.

Function Name and Parameters Specific Name
Sales(Quantity INTEGER, Profit INTEGER) S1
Sales(Quantity INTEGER, Profit FLOAT) S2
Sales(Quantity FLOAT, ProfiQuantityt INTEGER) S3
Sales(Quantity FLOAT, Profit FLOAT) S4

The following table identifies which function Vantage invokes when none of the functions have parameter types that are identical to the corresponding argument types of the function call.

Data Type of First Argument Data Type of Second Argument Specific Name of Invoked Function
BYTEINT INTEGER S1.

After testing the first argument, S1 and S2 remain on the list.

After testing the second argument, S1 is left.

DECIMAL SMALLINT S3.

After testing the first argument, S3 and S4 remain on the list.

After testing the second argument, S3 remains on the list.

The DECIMAL is converted to a FLOAT and the SMALLINT is converted to an INTEGER before the UDF is called.