BLOB type
Synopsis
BLOB
data type is used to represent arbitrary binary data of variable length.
Syntax
type_specification ::= BLOB
blob_literal ::= "0x" [ hex_digit hex_digit ...]
Where
hex_digit
is a hexadecimal digit ([0-9a-fA-F]
).
Semantics
- Columns of type
BLOB
can be part of thePRIMARY KEY
. - Implicitly,
BLOB
data type is neither convertible nor comparable with other data types. - Two series of builtin-functions
BlobAs<Type>
and<Type>AsBlob
are provided for conversion betweenBLOB
and other data types. BLOB
size is virtually unlimited.
Examples
cqlsh:example> CREATE TABLE messages(id INT PRIMARY KEY, content BLOB);
cqlsh:example> INSERT INTO messages (id, content) VALUES (1, 0xab00ff);
cqlsh:example> INSERT INTO messages (id, content) VALUES (2, 0x);
cqlsh:example> UPDATE messages SET content = 0x0f0f WHERE id = 2;
cqlsh:example> SELECT * FROM messages;
id | content
----+----------
2 | 0x0f0f
1 | 0xab00ff
See also
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .