UNHEX()

Function description

The UNHEX() function is used to convert a hexadecimal string to the corresponding binary string. For the NULL parameter, this function returns NULL.

Function Syntax

Text
> UNHEX(str)

Parameter definition

Parameters

Description

str

Required parameters. Must be a legal hexadecimal value.

Example

Text
mysql> SELECT UNHEX('4d6174726978204f726967696e');
+-----------------------------------+
| unhex(4d6174726978204f726967696e) |
+-----------------------------------+
| Matrix Origin                     |
+-----------------------------------+
1 row in set (0.00 sec)

mysql> select unhex(NULL);
+-------------+
| unhex(null) |
+-------------+
| NULL        |
+-------------+
1 row in set (0.00 sec)
Last updated on