SQL UDFs | CREATE/REPLACE FUNCTION | Teradata Vantage - SQL UDFs and Embedded SQL - Teradata Vantage - Analytics Database

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2024-12-13
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jbg1472252759029
lifecycle
latest
Product Category
Teradata Vantage™

You can invoke an SQL UDF from embedded SQL requests in the same way you would invoke an SQL UDF from an interactive SQL request. Other than restrictions that apply to the use of SQL expressions in an embedded SQL program (see Teradata Vantage™ - SQL Stored Procedures and Embedded SQL, B035-1148) you can invoke SQL UDFs from an embedded SQL request without any restrictions.

The following example shows one possible way to invoke an SQL UDF, in this case common_value_expression, from an embedded SQL request.

EXEC SQL FOR 19
  INSERT INTO t1
  VALUES (:var1, df2.common_value_expression(:var2, 2), :var3);