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
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
vnq1596660420420.ditamap
dita:ditavalPath
hoy1596145193032.ditaval

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