RAWTOHEX Function in Oracle SQL – PLSQL

The RAWTOHEX function in Oracle SQL / PLSQL is used to convert raw value to hexadecimal values.

Syntax for the RAWTOHEX function in Oracle SQL / PLSQL is:

SELECT RAWTOHEX (raw_value)
FROM table_name;


raw_value is the raw value that is to be converted to hexadecimal value.

Examples:
Using RAWTOHEX in Oracle SQL / PLSQL SELECT Statement

SELECT RAWTOHEX('A')
FROM DUAL;

Will return ‘41’ as hexadecimal value.

SELECT RAWTOHEX('AB')
FROM DUAL;

Will return ‘4142’ as hexadecimal value.

SELECT RAWTOHEX('Tech Honey')
FROM DUAL;

Will return ‘5465636820486F6E6579’ as hexadecimal value.


Tagged , , , , , , , , , , , . Bookmark the permalink.