Example: USING and SQL UDF Invocation - 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™

This example invokes the SQL UDF value_expression in a USING clause-based SELECT request.

     USING (a INTEGER, b INTEGER)
     SELECT test.value_expression(:a, :b) AS cve
     FROM t1
     WHERE t1.a1 = :a
     AND   t1.b1 = :b;

This example invokes the SQL UDF value_expression in a USING clause-based DELETE request.

     USING (a INTEGER, b INTEGER)
     DELETE FROM t1
     WHERE test.value_expression(:a, :b) > t1.a1;

This example, which invokes the SQL UDF value_expression in a USING clause-based SELECT request with mismatches of the data types of the arguments, aborts and returns an error.

     USING (a CHARACTER(10), b CHARACTER(10))
     SELECT test.value_expression(:a, :b) AS cve
     FROM t1
     WHERE t1.a1 = :a
     AND   t1.b1 = :b;