Syntax
bit_string_data_type ::
BIT
| BINARY [(length)]
| VARBINARY [(length)]
| LVARBINARY
Arguments
Type |
Syntax |
Description |
Default length |
Maximum length |
||||||||||||||||
BIT |
BIT |
Corresponds to a single bit value of 0 or 1. c-treeSQL statements can assign and compare values in BIT columns to and from columns of types BINARY, VARBINARY, TINYINT, SMALLINT, INTEGER, and Character types. However, in assignments from BINARY, VARBINARY, and LVARBINARY, the value of the first four bits must be 0001 or 0000. No arithmetic operations are allowed on BIT columns.
|
N/A |
N/A |
||||||||||||||||
BINARY |
BINARY [(length)] |
Corresponds to a bit field of the specified length in bytes. In interactive SQL, INSERT statements must use a special format to store values in BINARY columns. They can specify the binary values as a bit string, hexadecimal string, or character string. INSERT statements must enclose binary values in single-quote marks, preceded by b for a bit string and x for a hexadecimal string:
FairCom DB SQL interprets a character string as the character representation of a hexadecimal string. If the data inserted into a BINARY column is less than the length specified, FairCom DB SQL pads it with zeroes. BINARY data can be assigned and compared to and from columns of type BIT, VARBINARY, and Character types. No arithmetic operations are allowed. |
1 byte |
65,500 bytes (8192 bytes prior to V12) |
||||||||||||||||
VARBINARY |
VARBINARY [(length)] |
Corresponds to a variable-length bit field with maximum length specified. |
1 byte |
65,500 bytes (8192 bytes prior to V12) |
||||||||||||||||
LVARBINARY |
LVARBINARY |
Corresponds to an arbitrarily long bit field with the maximum length of less than two gigabytes. Recommended for BLOB support. The arbitrary size and unstructured nature of long data types restrict where they can be used:
|
N/A |
2 GB |