17.10 - Usage Notes - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1143-171K
Language
English (United States)

External Representation

Whenever a client application talks to Vantage, it indicates its character set (form-of-use for character data). Vantage returns all character data to the application in that form.

Whenever multibyte characters are involved, their representation has the length (n-2)/2 multibyte characters exclusive of the preceding Shift-Out and following Shift-In characters.

The following table lists the client representations for the CLOB data type. Determining the application definitions and client data types is the responsibility of the application programmer.

Define the length of the CLOB string as k, where 0 ≤ k ≤ n.

Client CPU Architecture Client Internal Data Format
IBM mainframe Eight byte (most significant byte first) length count k followed by k bytes of EBCDIC character data for a total of k+8 bytes.
  • UTS
  • RISC
  • Motorola 68000
  • WE 32000
Eight byte (most significant byte first) length count k followed by k bytes of ASCII character data for a total of k+8 bytes.
Intel Eight byte (least significant byte first) length count k followed by k bytes of ASCII character data for a total of k+8 bytes.

Restrictions

A table can have a maximum of 32 LOB columns.

Queue tables cannot have CLOB columns.

A LOB column cannot be a component of an index. Because of this restriction, a table must define at least one non-LOB column.

The CHARACTER SET clause can specify the following server character sets for a CLOB column:
  • LATIN
  • UNICODE

Functions That Operate on CLOBs

The following are some functions and operators that support CLOB types:
  • CHARACTERS/CHARS/CHAR
  • MCHARACTERS
  • CHARACTER_LENGTH
  • TRANSLATE and TRANSLATE_CHK
  • SUBSTRING/SUBSTR
  • Concatenation operator (||)
  • TYPE
  • Explicit data type conversion (CAST and Teradata conversion syntax)
  • User-defined functions (UDFs)
  • Stored procedures
  • External stored procedures