CREATE/REPLACE FUNCTION Examples | Teradata Database - Example: Defining an SQL UDF With a LOB Parameter - Teradata Database

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Teradata Database
Release Number
20.00
Publication Date
June 2025
Content Type
SQL Reference
Publication ID
B035-1144-200K
ft:locale
en-US
ft:lastEdition
2026-09-23
dita:mapPath
mbm1747160743883.ditamap
dita:ditavalPath
jlp1749501702948.ditaval
ft:sourceId
dita
dita:id
mdr1472255012272
lifecycle
latest

The following CREATE FUNCTION request specifies a CLOB as a parameter in its definition.

CREATE FUNCTION test.myudf (a CLOB, b INTEGER, c INTEGER, 
                            d CHARACTER (100))
RETURNS CHAR(50)
LANGUAGE SQL
DETERMINISTIC
CONTAINS SQL
SPECIFIC test.myudf
CALLED ON NULL INPUT
SQL SECURITY DEFINER
COLLATION INVOKER
INLINE TYPE 1
RETURN d || (SUBSTRING(a FROM b FOR c));