HEX()

Overview

Returns a hexadecimal string representation of the argument.

USAGE

HEX(string | number)

Argument Name

Description

string | number

The string or number to convert

DETAILS

  • HEX() is a string function that returns a hexadecimal string representation of the argument.

  • When given a string argument, each byte is converted into a 2-digit hexadecimal representation and the concatenated string of hex digits is returned.

  • When given a numeric argument, the hexadecimal representation of the 64-bit number is returned as a string.

  • A NULL is returned if the argument is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT HEX(125), HEX('dbms'), CONV(HEX(125), 10, 10);
+----------+-------------+------------------------+
| HEX(125) | HEX('dbms') | CONV(HEX(125), 10, 10) |
+----------+-------------+------------------------+
| 7D       | 64626D73    | 7                      |
+----------+-------------+------------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES