Method Invocation | SQL Operators & User-Defined Functions | Teradata Vantage - Method Invocation - Advanced SQL Engine - Teradata Database

SQL Operators and User-Defined Functions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2023-04-27
dita:mapPath
fsi1592016213432.ditamap
dita:ditavalPath
fsi1592016213432.ditaval
dita:id
B035-1210
lifecycle
previous
Product Category
Teradata Vantage™

Invokes a method associated with a UDT.

ANSI Compliance

This statement is ANSI SQL:2011 compliant, but includes non-ANSI Teradata extensions.

The requirement that parentheses appear when the argument list is empty is a Teradata extension to preserve compatibility with existing applications.

Additionally, when a statement specifies an ambiguous expression that can be interpreted as a UDF invocation or a method invocation, Teradata gives UDF invocation higher precedence over method invocation. ANSI SQL:2011 gives method invocation higher precedence over UDF invocation.

Syntax

{ [ [ database_name. ]  table_name. ] column_name |

  udf_name ( [ argument_1 [,...] ] ) |

  CAST ( expression AS udt_name ) |

  [ NEW [SYSUDTLIB.] ] constructor_name ( [ argument_2 [,...] ] )

}.method_name_spec [,...]
method_name_spec
method_name ( [ argument_3 [,...] ] )

Syntax Elements

database_name
A qualifier for the column_name.
table_name
A qualifier for the column_name.
column_name

The name of a distinct or structured UDT column.

Constructor methods have the same name as the UDT with which they are associated.

udf_name

The name of a distinct or structured UDT data type.

Constructor methods have the same name as the UDT with which they are associated.

argument

An argument to the UDF.

An argument to pass to the constructor.

An argument to pass to the method.

Parentheses must appear even though the argument list may be empty.

CAST

A CAST expression that converts a source data type to a distinct or structured UDT.

Data type conversions involving UDTs require appropriate cast definitions for the UDTs. To define a cast for a UDT, use the CREATE CAST statement. For more information on CREATE CAST, see Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.

expression
An expression that results in a data type that is compatible as the source type of a cast definition for the target UDT.
NEW
An expression that constructs a new instance of a structured type and initializes it using the specified constructor method.
SYSUDTLIB.

The database in which the constructor exists.

Vantage only searches the SYSUDTLIB database for UDT constructors, regardless of whether the database name appears in the expression.

constructor_name

The name of a constructor method associated with a UDT.

Constructor methods have the same name as the UDT with which they are associated.

method_name

The name of an observer, mutator, or user-defined method (UDM).

You must precede each method name with a period.