Constructor Methods - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

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
2024-10-04
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jbg1472252759029
lifecycle
latest
Product Category
Teradata Vantage™

Constructor methods initialize a structured UDT instance with input arguments, creating an instance value for the type. The ANSI SQL standard defines something called a site, which is little more than an umbrella name assigned to a large set of different kinds of variables. Incorporating this definition, a structured UDT is seen to determine a type that is the data type of a site. Again, this does little more than state that a structured UDT is the data type of an instance of a variable.

A constructor method, then, assigns specific values to the elements of a site according to the attributes of the structured UDT that is the data type for that site.

The specification of a constructor method must comply with the following rules:
  • SELF AS RESULT must be specified as part of the method specification in the definition of the structured UDT (see CREATE TYPE (Structured Form)).
  • The method name must be identical to the name of the structured data type being defined.
  • The return data type specified for CONSTRUCTOR METHOD in the definition of the structured UDT must be identical to the data type for the corresponding attribute in the member list of the structured type definition.