Example: USING and SQL UDF Invocation - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

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;