TEXT

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

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

Syntax

TEXT [ ( length [{K |M |G}] ) ]

length

An unsigned integer constant that specifies the number of characters in the TEXT 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 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( txtCol TEXT(65535));