- Categories:
Semi-structured and structured data functions (Type Predicates)
IS_BINARY¶
Returns TRUE if its VARIANT argument contains a binary string.
- See also:
Syntax¶
IS_BINARY( <variant_expr> )
Examples¶
Get all binary values in a variable column.
Note
The output format for binary values is set using the BINARY_OUTPUT_FORMAT parameter. The default setting is HEX
.
Create and load the table:
create or replace table varbin (v variant); insert into varbin select to_variant(to_binary('snow', 'utf-8'));
Show the data:
select v AS hex_encoded_binary_value from varbin where is_binary(v); +--------------------------+ | HEX_ENCODED_BINARY_VALUE | |--------------------------| | "736E6F77" | +--------------------------+