CLOB

A CLOB (character large object) value can be up to 2 GB (2,147,483,647 characters) long. A CLOB is used to store unicode character-based data, such as large documents in any character set.

If you’re using a CLOB with the 32-bit version of our ODBC driver, the size of the CLOB is limited to 512 MB, due to address space limitations.

Note that, in Splice Machine, TEXT is a synonym for CLOB, and that the documentation for the  TEXT data type functionally matches the documentation for this topic. Splice Machine simply translates TEXT into CLOB.

Syntax

{CLOB | CHARACTER LARGE OBJECT} [ ( length [{K |M |G}] ) ]

length

An unsigned integer constant that specifies the number of characters in the CLOB unless you specify one of the suffixes you see below, which change the meaning of the length value. If you do not specify a length value, it defaults to two giga-characters (2,147,483,647).

K

If specified, indicates that the length value is in multiples of 1024 (kilo-characters).

M

If specified, indicates that the length value is in multiples of 1024*1024 (mega-characters).

G

If specified, indicates that the length value is in multiples of 102410241024 (giga-characters).

Corresponding Compile-time Java Type

java.sql.Clob

JDBC Metadata Type (java.sql.Types)

CLOB

Usage Notes

Use the getClob method on the java.sql.ResultSet to retrieve a CLOB handle to the underlying data.

There are a number of restrictions on using using BLOBand CLOB / TEXT objects, which we refer to as LOB-types:

  • LOB-types cannot be compared for equality (=) and non-equality (!=, <>).
  • LOB-typed values cannot be ordered, so <, <=, >, >= tests are not supported.
  • LOB-types cannot be used in indexes or as primary key columns.
  • DISTINCT, GROUP BY, and ORDER BY clauses are also prohibited on LOB-types.
  • LOB-types cannot be involved in implicit casting as other base-types.

Example

CREATE TABLE myTable( largeCol CLOB(65535));