Icon Binary Types

Binary types are used when you wish to store a series of bytes with a fixed or variable length, including very large series of bytes.

TypeDescription
BYTE[(<Length>)]A binary value with a fixed number of bytes. If the length of the binary value is not specified, then a length of 1 is used. The maximum length is 1024 bytes. When assigning a value to a BYTE type value that is smaller in length than the specified length, the value being assigned will be padded with NULL bytes (0) to the specified length. For example, if you have a column defined as:

MyColumn BYTE(8)

If you were to assign the value 0x00 0x01 0x02 0x03 to the column, then the MyColumn column would contain the value 0x00 0x01 0x02 0x03 0x00 0x00 0x00 0x00 after the assignment.
BYTE VARYING(<Length>)
VARBYTE(<Length>)
A binary value with a variable number of bytes. The length of the binary value must always be specified. The maximum length is 1024 bytes. Contrary to the BYTE type, this type does not pad the binary value with NULL bytes (0).
BINARY LARGE OBJECT
BLOB
A large, variable-length binary value with a maximum size of 2GB.

Literals
Binary literals use the 'X' character along with the single quote (') character to identify themselves as such. The contents of a binary literal consists of the bytes that make up the value encoded in hexadecimal form, such that each byte is represented by two characters from the range of '00' (0) to 'FF' (255).

Literal Examples
-- This example specifies a BYTE literal

SELECT * FROM Instruments WHERE Data = X'01F21028'

SQL 2003 Standard Deviations
The following areas are where ElevateDB deviates from the SQL 2003 standard:

DeviationDetails
BLOB TypeElevateDB does not support the specification of a default size in KB, MB, or GB for large object types.
BYTE and BYTE VARYING TypesElevateDB adds the BYTE and BYTE VARYING (VARBYTE) types as extended types.
Image