hex
The hex function is used to convert an integer or character to its hexadecimal representation.
Syntax
hex(BIGINT a)
Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| a | Yes | DOUBLE, BIGINT, DECIMAL, or STRING | The format of parameter a includes floating-point format, integer format, and string format. If parameter a is not of type BIGINT, it is implicitly converted to BIGINT type before evaluation. Strings are converted to their corresponding ASCII codes. |
Return Values
Returns STRING type.
- If a is 0, 0 is returned.
- If a is NULL, NULL is returned.
Example Code
Returns 0.
select hex(0);
Returns 61.
select hex('a'); Returns 10.
select hex(16);
Returns 31.
select hex('1'); Returns 3136.
select hex('16'); Returns NULL.
select hex(null);
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot