Oracle: How do I convert hex to decimal in Oracle SQL?
If you are using 8.1.5 and above you can use:
To convert from hexadecimal to decimal:
select to_number('AA', 'xx') from dual;
To convert from decimal to hexadecimal:
select to_char(111, 'xxxx') from dual;
SELECT TO_NUMBER('DEADBEEF', 'XXXXXXXX')
FROM dual
---
3735928559
SELECT TO_CHAR(3735928559, 'XXXXXXXX')
FROM dual
---
DEADBEEF