Example: Dynamic UDT Expressions - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

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-04-05
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

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;

Result:

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

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