Type Conversion and Performance - 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ā„¢

As with other functions and operators, Vantage performs implicit conversion of types that are compatible with LOBs according to the rules of precedence. If you define a UDF that declares a LOB type parameter, you can call the UDF and pass a compatible argument.

Declared Parameter Type Passed Parameter Type
CLOB
  • VARCHAR
  • CHAR
BLOB
  • VARBYTE
  • BYTE

Implicit conversions of types compatible with LOBs can have performance consequences.

For example, suppose a UDF declares a BLOB parameter. If you call the UDF and pass in a VARBYTE column, Vantage converts the VARBYTE value to a temporary BLOB and passes the BLOB value to the UDF. Because Vantage stores the temporary BLOB on disk, the performance cost of the conversion is significant.

A solution is to create an overloaded function that explicitly declares a VARBYTE argument.