HEXTORAW

HEXTORAW is an SQL function that converts a hexadecimal string into a raw value or raw data type. Its main use is to convert data that is stored or displayed as hexadecimal back into a raw format for manipulation or comparison within the database.

HEXTORAW(n CHAR) RETURN RAW;

  • n char: The hexadecimal string to be converted into raw format. The input is a character data that represents hexadecimal digits, where each byte in the raw corresponds to two hexadecimal digits.

Example

SELECT HEXTORAW('53656C656374') FROM dual;

Output

53656C656374

Explanation

The HEXTORAW function in Oracle is used to convert hexadecimal values to raw data type. In the above example, the SELECT statement uses the HEXTORAW function to convert the hexadecimal string ‘53656C656374’ to its raw value. The resulting value is displayed within the output of the SELECT statement.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.