SQL_TEXT Definition | SQL External Routine Programming | Teradata Vantage - SQL_TEXT Definition - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

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