Conversion and Error Handling - ODBC Driver for Teradata

ODBC Driver for Teradata User Guide

Product
ODBC Driver for Teradata
Release Number
15.10
Language
English (United States)
Last Update
2018-10-07
dita:id
B035-2526
lifecycle
previous
Product Category
Teradata Tools and Utilities

This section describes how ODBC Driver for Teradata:

  • Converts Parameter and Result set data to or from C data types to or from session character set
  • Converts SQL-Text to session character set
  • Handles conversion errors
  • Parameter and Result Set Data

    Table 41 lists parameter and result set data.

     

    Table 41: Parameter and Result Set Data 

     

    Session Character Set ASCII

    Session Character Set
    Non-Unicode

    Session Character Set Unicode

    SQL_C_CHAR

    No Conversion

    No Conversion

    Convert from Application Code Page to Unicode

    Note: See “Application Code Page” on page 124.

    SQL_C_WCHAR

    Convert from Application Code Page to Platform Unicode representation

    Convert from Session Character Set to the Platform Unicode representation (UTF-8 on the UNIX OS, UTF-32 on Apple OS X, and UTF-16 on Windows)

    No Conversion when session character set matches the Platform Unicode representation (UTF-8 on the UNIX OS, and UTF-16 on Windows. On Apple OS X, convert from session character set to UTF-32 Unicode representation.

    Error Handling

    Not all characters can be converted between Unicode and other non-Unicode code pages. Therefore, some characters are converted into error characters. For additional information on error characters, see Chapter 8 in International Character Set Support. In most cases, conversion errors result in the following Teradata Database errors:

  • 6706 – The string contains an untranslatable character
  • 6705 – An illegally formed character string was encountered during translation
  • In some cases, the “?” is used as the error character. In these cases, Teradata Database cannot detect conversion errors. Therefore, SQL-Text and character strings should match the session character set repertoire to avoid conversion errors.