Skip to main content
Converts a binary value to a VARCHAR string based on the specified binary format (binary_type). The following binary formats are supported: hex, encode64, and utf8. If no binary_type is specified, hex is the default.

Syntax

Parameters

  • binary: the input binary to convert, required.
  • binary_type: the binary format for conversion, optional.
    • hex (default): from_binary uses the hex method to encode the input binary to a VARCHAR string.
    • encode64: from_binary uses the base64 method to encode the input binary to a VARCHAR string.
    • utf8: from_binary converts the input binary to a VARCHAR string without any transformation.

Return value

Returns a VARCHAR string.

Examples

References