16.20 - SQL_TEXT Definition - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Advanced SQL Engine
Teradata Database
Release Number
Release Date
April 2020
Content Type
Programming Reference
Publication ID
English (United States)

Before you include the sqltypes_td.h header file, you must define the SQL_TEXT constant. The value that you use must match the current server character set of the session in which you use the CREATE FUNCTION statement to create the UDF.

IF you use the CREATE FUNCTION statement when the current server character set is … THEN the function must set SQL_TEXT to …
KANJI Kanji1_Text
KANJISJIS Kanjisjis_Text
LATIN Latin_Text
UNICODE Unicode_Text

SQL_TEXT is used for specific UDF arguments when the UDF uses parameter style SQL. For more information on parameter styles, see Scalar Function Parameter List, Aggregate Function Parameter List, and Table Function Parameter List.

Teradata Database remembers the character set the UDF was created under so the UDF can translate SQL_TEXT input arguments to the expected text and translate text to SQL_TEXT output arguments, no matter who calls the UDF and what the current server character set is for the session.

In accordance with Teradata internationalization plans, KANJI1 support is deprecated and is to be discontinued in the near future. KANJI1 is not allowed as a default character set; the system changes the KANJI1 default character set to the UNICODE character set. Creation of new KANJI1 objects is highly restricted. Although many KANJI1 queries and applications may continue to operate, sites using KANJI1 should convert to another character set as soon as possible