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.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
spp1591731285373.ditamap
dita:ditavalPath
spp1591731285373.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';