Starting in Oracle8i, the TO_CHAR and
TO_NUMBER functions can handle
conversions from base 10 (decimal) to
base 16 (hexadecimal) and back again:
SQL> select to_char(123,'XX') to_hex,
2 to_number('7B','XX') from_hex
3 from dual
4 /
TO_ FROM_HEX
------ -----------------
7B 123
source