Data Types

The SQL type system is used by the language compiler to determine the compile-time type of an expression and by the language execution system to determine the runtime type of an expression, which can be a subtype or implementation of the compile-time type.

Each type has associated with it values of that type. In addition, values in the database or resulting from expressions can be NULL, which means the value is missing or unknown. Although there are some places where the keyword NULL can be explicitly used, it is not in itself a value, because it needs to have a type associated with it.

This section contains the reference documentation for the Splice Machine SQL Data Types, in the following subsections:

Character String Data Types

These are the character string data types:

Data Type Description
CHAR

The CHAR data type provides for fixed-length storage of strings.

LONG VARCHAR

The LONG VARCHAR type allows storage of character strings with a maximum length of 32,700 characters. It is identical to VARCHAR, except that you cannot specify a maximum length when creating columns of this type.

VARCHAR The VARCHAR data type provides for variable-length storage of strings.

Date and Time Data Types

These are the date and time data types:

Data Type Description
DATE

The DATE data type provides for storage of a year-month-day in the range supported by java.sql.Date.

TIME

The TIME data type provides for storage of a time-of-day value.

TIMESTAMP The TIMESTAMP data type stores a combined DATE and TIME value, and allows a fractional-seconds value of up to nine digits.

Large Object Binary (LOB) Data Types

These are the LOB data types:

Data Type Description
BLOB

The BLOB (binary large object) data type is used for varying-length binary strings that can be up to 2,147,483,647 characters long.

CLOB

The CLOB (character large object) data type is used for varying-length character strings that can be up to 2,147,483,647 characters long.

TEXT Exactly the same as CLOB.

Numeric Data Types

These are the numeric data types:

Data Type Description
BIGINT

The BIGINT data type provides 8 bytes of storage for integer values.

DECIMAL

The DECIMAL data type provides an exact numeric in which the precision and scale can be arbitrarily sized.

You can use DECIMAL and NUMERIC interchangeably.

DOUBLE

The DOUBLE data type provides 8-byte storage for numbers using IEEE floating-point notation.

DOUBLE PRECISION can be used synonymously with DOUBLE.

DOUBLE PRECISION

The DOUBLE PRECISION data type provides 8-byte storage for numbers using IEEE floating-point notation.

DOUBLE can be used synonymously with DOUBLE PRECISION.

FLOAT

The FLOAT data type is an alias for either a REAL or DOUBLE PRECISION data type, depending on the precision you specify.

INTEGER

INTEGER provides 4 bytes of storage for integer values.

NUMERIC

The NUMERICdata type provides an exact numeric in which the precision and scale can be arbitrarily sized.

You can use NUMERIC and DECIMAL interchangeably.

REAL

The REAL data type provides 4 bytes of storage for numbers using IEEE floating-point notation.

SMALLINT

The SMALLINT data type provides 2 bytes of storage.

TINYINT

The TINYINT data type provides 1 byte of storage.

Other Data Types

These are the other data types:

Data Type Description
BOOLEAN

Provides 1 byte of storage for logical values.

See Also