Teradata provides the sqltypes_td.h header file that you include in your source code file. The header file defines the equivalent C data types for all database data types that you can use for the input arguments and result of your UDMs. Every SQL data type corresponds to a C data type in sqltypes_td.h.
Location
The header file is in the etc directory of the Teradata software distribution:
/usr/tdbms/etcTo verify the path of the etc directory, enter the following on the command line:
pdepath -eSQL_TEXT Definition
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 METHOD statement to create the UDM.
IF you use the CREATE METHOD statement when the current server character set is … | THEN the C or C++ function must set SQL_TEXT to … |
---|---|
KANJI | Kanji1_Text |
KANJISJIS | Kanjisjis_Text |
LATIN | Latin_Text |
UNICODE | Unicode_Text |
SQL_TEXT is used for specific UDM arguments when the UDM uses parameter style SQL. For details on parameter styles, see UDM Parameter List.
Vantage remembers the character set the UDM was created under so that the UDM can translate SQL_TEXT input arguments to the expected text and translate text to SQL_TEXT output arguments, no matter who invokes the UDM and what the current server character set is for the session.
Example: Defining SQL_TEXT and Including sqltypes_td.h
The following example shows how to define SQL_TEXT and include the sqltypes_td.h header file in the file that defines a UDM:
#define SQL_TEXT Latin_Text #include "sqltypes_td.h"
Alternatively, you can use the following line to include the sqltypes_td.h header file:
#include <sqltypes_td.h>
Using angle brackets (< >) or double quotation marks (" ") affects the path that the C preprocessor uses to search for the sqltypes_td.h header file.
SQL Data Types
Every SQL data type corresponds to a C data type that you use for the input arguments and result of your UDM.
For more information, see SQL Data Type Mapping.
For exact definitions, see the sqltypes_td.h header file.