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

ODBC Driver for Teradata® User Guide

Product
ODBC Driver for Teradata
Release Number
17.10
Published
October 2021
Language
English (United States)
Last Update
2021-11-02
dita:mapPath
wxs1608578396899.ditamap
dita:ditavalPath
nkw1500504256726.ditaval
dita:id
B035-2526
lifecycle
previous
Product Category
Teradata Tools and Utilities

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.