This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-21. For the latest, interactive version please visit https://mariadb.com/kb/.

UNHEX

Sintassi

UNHEX(str)

Spiegazione

Effettua l'operazione inversa rispetto a HEX(str). Interpreta ogni coppia di cifre esadecimali presenti nell'argomento come numero e converte il tutto nel carattere rappresentato da quel numero. I caratteri risultanti sono restituiti come stringa binaria.

Esempi

MariaDB [(none)]> SELECT HEX('MariaDB');
+----------------+
| HEX('MariaDB') |
+----------------+
| 4D617269614442 |
+----------------+
1 row in set (0.00 sec)

MariaDB [(none)]> SELECT UNHEX('4D617269614442');
+-------------------------+
| UNHEX('4D617269614442') |
+-------------------------+
| MariaDB                 |
+-------------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> SELECT 0x4D617269614442;
+------------------+
| 0x4D617269614442 |
+------------------+
| MariaDB          |
+------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> SELECT UNHEX(HEX('string'));
+----------------------+
| UNHEX(HEX('string')) |
+----------------------+
| string               |
+----------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> SELECT HEX(UNHEX('1267'));
+--------------------+
| HEX(UNHEX('1267')) |
+--------------------+
| 1267               |
+--------------------+
1 row in set (0.00 sec)
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.