Example: Function Selection for Character 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 Find_Text functions and the corresponding specific name as specified in the SPECIFIC clause of CREATE FUNCTION.

Function Name and Parameters Specific Name
Find_Text(SearchedString CHAR(40), Pattern VARCHAR(10)) F1
Find_Text(SearchedString VARCHAR(10), Pattern CHAR(20)) F2
Find_Text(SearchedString CHAR(20), Pattern CHAR(10)) F3

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 What Vantage Does
VARCHAR(40) CHAR(50) Invokes function with specific name F2.

After testing the first argument, F2 remains on the list.

After testing the second argument, F2 is left (exact match).

The length of character string is not considered, so truncation is possible.

VARCHAR(80) VARCHAR(20) Returns error.

After testing the first argument, F2 remains on the list.

After testing the second argument, nothing remains on the list. F2 is not selected because the function is asking for a VARCHAR and the only option is a CHAR, which is of a lower precedence than the VARCHAR.

Do not use CHAR as a parameter type if you want a function to be found with a VARCHAR argument.