16.20 - Example Query - 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)

Assume that there is a table ByteIntTable defined as follows:

SELECT * FROM ByteIntTable ORDER BY 1; 

   *** Query completed. 6 rows found. 3 columns returned.
   *** Total elapsed time was 1 second.

   RowNumber  ByteIntColumn  Remark
 -----------  -------------  --------------------
           1              1  Nominal Value
           2           -128  Lower Limit
           3            127  Upper Limit
           4              0  Zero Value
           5              ?  NULL Value
           6             50  Character Literal

The following is a sample query that calls the AggFncWAnytype function.

SELECT  (AggFncWAnytype (ByteIntColumn) RETURNS INT)
FROM ByteIntTable ORDER BY 1;

The output from the query is:

AggFncWAnytype(1)
-----------------
               10