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

ODBC Driver for Teradata User Guide

Product
ODBC Driver for Teradata
Release Number
16.10
Published
May 2017
Language
English (United States)
Last Update
2018-07-11
dita:mapPath
smj1488824663219.ditamap
dita:ditavalPath
Audience_PDF_product_legacy_odbc_include.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 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.