17.20 - Using User-Defined Types with ODBC - ODBC Driver for Teradata

ODBC Driver for Teradata® User Guide

Product
ODBC Driver for Teradata
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2022-06-21
dita:mapPath
uqj1639470627591.ditamap
dita:ditavalPath
nkw1500504256726.ditaval

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 database type. For example, when the select-list of a SELECT statement contains a UDT expression, the 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 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.