16.20 - SQL Definition - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)

Here is the SQL definition of a VARCHARUDT distinct UDT.

CREATE TYPE VARCHARUDT AS VARCHAR(20000) FINAL;

The table AggrDataTable defines a VARCHARUDT column.

CREATE TABLE AggrDataTable (aggrID int, aggrName varcharudt);

The following CREATE FUNCTION statement installs the aggregate function:

CREATE FUNCTION udf_agch002002udt  (parameter_1 VARCHARUDT)
   RETURNS VARCHARUDT   
   CLASS AGGREGATE (20000)
   LANGUAGE C  
   NO SQL
   EXTERNAL NAME 'CS!udf_agch002002udt!udf_agch002002udt.c'
   PARAMETER STYLE SQL;