HEX_ENCODE()
Encodes a (binary) value to a hexadecimal string
VARCHAR CHARACTER SET ASCII
or BLOB SUB_TYPE TEXT CHARACTER SET ASCII
HEX_ENCODE (binary_data)
Parameter | Description |
---|---|
binary_data |
Binary data (or otherwise convertible to binary) to encode |
HEX_ENCODE
encodes binary_data with hex, and returns the encoded value as a VARCHAR CHARACTER SET ASCII
or BLOB SUB_TYPE TEXT CHARACTER SET ASCII
as appropriate for the input.
When the input is not BLOB
, the length of the resulting type is calculated as type_length * 2
, where type_length is the maximum length in bytes of the input type.If this length exceeds the maximum length of VARCHAR
, the function returns a BLOB
.