Example: Different LOB Specifications for Parameter and RETURNS TABLE Clauses - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

The following example indicates the different ways you must specify LOB data types for function parameters and table columns, respectively. Notice how the parameter type specifications require the specification of an AS LOCATOR phrase, while the table column specifications prohibit the use of an AS LOCATOR phrase.

     CREATE FUNCTION lobtf_concat3 (
      NumRows INTEGER,
     A       BLOB AS LOCATOR,
     B       VARBYTE(64000),
     C       BLOB AS LOCATOR)
     RETURNS TABLE (ampnum   INTEGER,
     a_out    BLOB(10),
     b_out    VARBYTE(10),
     c_out    BLOB(10),
     myresult BLOB(30))
     LANGUAGE C
     NO SQL
     PARAMETER STYLE SQL
       EXTERNAL NAME 'SS!lobtf_concat3!/home/i18n/hsf/tf/c/
                       lobtf_concat3.c';