3. Understanding SQL Data Types : SQL Data Types : Binary Data Types : Long Byte Data Types
 
Share this page                  
Long Byte Data Types
The long byte data type has the same characteristics as the byte varying data type, but can accommodate binary data up to 2 GB in length.
If a length is declared for this type of column, it represents the size of the inline space to store the initial n bytes of data for the large object. For more information, see Storing BLOBs Inline the Database Administrator Guide.
In embedded SQL data handlers can be created, which are routines to read and write the data for long byte columns. For details about data handlers, see Data Handlers for Large Objects (see Data Handlers for Large Objects) and the Embedded SQL Companion Guide.
Restrictions on Long Byte Columns
The following restrictions apply to long byte columns:
They cannot be part of a table key.
They cannot be part of a secondary index.
They cannot be used in the ORDER BY or GROUP BY clause of a SELECT statement.
They cannot have query optimization statistics. For details about query optimization statistics, see the optimizedb command in the Command Reference Guide.
The following string functions do not work with long byte columns:
LOCATE
PAD
SHIFT
SQUEEZE
TRIM
NOTRIM
CHAREXTRACT
BYTEEXTRACT
LEFT
RIGHT
SUBSTRING
They cannot be directly compared to other data types. To compare a long byte column to another data type, apply a coercion function.
A declared length for this type of column represents the size in bytes of the inline space, not a maximum size.
A literal of more than 2000 bytes cannot be assigned to a long byte column. For details about assigning long values to long byte columns, see the description of data handlers in the Embedded SQL Companion Guide, Dynamic Programming (see Dynamic Programming) in the chapter “Embedded SQL” or the OpenAPI User Guide.