CLOB Data Type | Data Types and Literals | Teradata Vantage - 17.10 - CLOB Data Type - 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)

Represents a large character string. A character large object (CLOB) column can store character data, such as simple text or HTML.

A CLOB column can store XML or JSON documents; however, Teradata recommends that you use the Teradata XML and Teradata JSON data types for that purpose.

ANSI Compliance

CLOB is ANSI SQL:2011 compliant.

Syntax

{ CHARACTER LARGE OBJECT | CLOB }
   [ ( n [ K | M | G ] ) ]
   [ { CHARACTER | CHAR } SET { LATIN | UNICODE } ]
   [ attribute [...] ]

Syntax Elements

n
The number of characters to allocate for the CLOB column. The maximum value depends on the server character set:
  • For the LATIN server character set, n cannot exceed 2097088000.
  • For the UNICODE server character set, n cannot exceed 1048544000.
If a value for n is not specified, the default is the maximum value.
K
The number of characters to allocate for the CLOB column is nK, where K = 1024 and the maximum value for n is as follows:
  • For the LATIN server character set, n cannot exceed 2047937.
  • For the UNICODE server character set, n cannot exceed 1023968.
M
The number of characters to allocate for the CLOB column is nM, where M = 1024K and the maximum value for n is as follows:
  • For the LATIN server character set, n cannot exceed 1999.
  • For the UNICODE server character set, n cannot exceed 999.
G
The number of characters to allocate for the CLOB column is nG, where G = 1024M. When G is specified, n must be 1 and the server character set must be LATIN.
CHARACTER SET
The server character set for the CLOB column being defined:
  • The LATIN server character set represents fixed 8-bit characters from the ASCII ISO 8859 Latin1 or ISO 8859 Latin9 repertoires.
  • The UNICODE server character set represents fixed 16-bit or 32-bit characters from the Unicode® standard.
If the CHARACTER SET clause is omitted, the default server character set depends on how the user is defined in the DEFAULT CHARACTER SET clause of the CREATE USER statement. For details, see Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.
Also see CHARACTER SET Phrase.
attribute
Appropriate data type, column storage, or column constraint attributes.
A CLOB column supports the following attributes:
  • NOT NULL
  • FORMAT
  • TITLE
For more information about the NOT NULL attribute, see Default Value Control Phrases.
For more information about the FORMAT and TITLE attributes, see Data Type Formats and Format Phrases.