This function is used to convert an integer or character into its hexadecimal representation.
hex(BIGINT a)
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
a |
Yes |
DOUBLE, BIGINT, DECIMAL, or STRING |
The value can be a float, integer, or string. If the value is not of the BIGINT type, the system will implicitly convert it to the BIGINT type for calculation. The string is converted to its corresponding ASCII code. |
The return value is of the STRING type.
The value 0 is returned.
select hex(0);
The value 61 is returned.
select hex('a');
The value 10 is returned.
select hex(16);
The value 31 is returned.
select hex('1');
The value 3136 is returned.
select hex('16');
The value NULL is returned.
select hex(null);