Example: Function Selection for NULL as a Literal Argument - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

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

Function Name and Parameters Specific Name
Extrapolate(a INTEGER, b INTEGER, c INTEGER) S1
Extrapolate(a VARCHAR(20), b VARCHAR(20), c VARCHAR(20)) S2

The results of calling the function with NULL as a literal argument appears in the following table.

IF the function invocation is … THEN Teradata Database …
SELECT Extrapolate(3, NULL, 9);
invokes the function name with the specific name S1.
SELECT Extrapolate('Ver', NULL, '*.*');
invokes the function name with the specific name S2.
SELECT Extrapolate(NULL, NULL, NULL);
returns an error.
SELECT Extrapolate(CAST(NULL AS INTEGER), NULL, NULL);
invokes the function name with the specific name S1.