Using User-Defined Types with ODBC

ODBC Driver for Teradata® User Guide

prodname
ODBC Driver for Teradata
vrm_release
16.20
category
User Guide
featnum
B035-2526-108K

ODBC applications always transfer values of a UDT as values of the external type associated with the UDT and the external type is always a predefined Teradata Database type. For example, when the select-list of a SELECT statement contains a UDT expression, the Teradata Database server automatically converts the UDT data to its external type before returning the data to the ODBC application. When inserting into a UDT column, the Teradata Database server automatically converts the external type data to UDT internal format. Therefore, the use of UDTs in requests and result sets is transparent to the ODBC application.

Creating a UDT using ODBC Driver for Teradata is done in a similar manner to creating other database objects. The ODBC client calls the ODBC SQLExecDirect() functions (or SQLPrepare() plus SQLExecute() to issue the appropriate “CREATE TYPE...” SQL statement followed by “CREATE METHOD...”, “CREATE TRANSFORM...”, and “CREATE ORDERING...” statements as needed to fully create the type.

UDTs are visible in the ODBC catalog functions and in Results.