17.05 - Example: Dynamic UDT Expressions - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Release Date
January 2021
Content Type
Programming Reference
Publication ID
B035-1146-175K
Language
English (United States)

The following example shows one way to use a dynamic UDT expression in a table UDF with a USING request modifier:

     .IMPORT INDICDATA FILE lobudt003.data

     USING(p1 INTEGER, p2 INTEGER, p3 BLOB)
     SELECT *
     FROM TABLE(dyntbf003(:p2,
                NEW VARIANT_TYPE(:p2 AS a,:p3 AS b))) AS t1
     ORDER BY 1;

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

            R1         R3                                          R2
     ---------    -------    ----------------------------------------
            10          0    1111111111111111111111111111111111111110
            11          1    1111111111111111111111111111111111111110