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

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1144-171K
Language
English (United States)

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';