UDM Parameters | C/C++ UDMs | Teradata Vantage - UDM Parameters - 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™

Parameter List

The list of parameters for a UDM is very specific. It includes the following:
  • The handle of the UDT with which the UDM is associated
  • Input parameters that are specified during method invocation
  • Output parameters that return the result of the UDM and the SQLSTATE result code

A UDM can have 0 to 128 input parameters. The types that you use as input parameters correspond to SQL data types in the method invocation. For more information, see SQL Data Type Mapping.

Additional parameters might be required, depending on the parameter passing convention you choose.

Parameters are almost always specified as pointers to the data.

Compatible Types

The argument types passed in to a UDM during method invocation do not always have to be an exact match with the corresponding parameter declarations in the function definition, but they must be compatible and follow the precedence rules that apply to compatible types.

For more information, see Compatible Types.

Parameter Passing Convention

UDMs support two types of parameter passing conventions.

Parameter Passing Convention Description
Parameter Style SQL Provides a way to pass nulls as input arguments and return a null as the result.
Parameter Style TD_GENERAL Does not accept null input arguments and does not return a null result.

The parameter passing convention you use to code a UDM must correspond to the parameter passing specification of the METHOD specification in the CREATE TYPE statement for the UDT.

IF the METHOD specification in the CREATE TYPE statement specifies … THEN use the following syntax for the function parameter list …
PARAMETER STYLE SQL or omits the PARAMETER STYLE option Syntax for Parameter Style SQL
PARAMETER STYLE TD_GENERAL Syntax for Parameter Style TD_GENERAL