Oracle: How do I convert hex to decimal in Oracle SQL?

database, hex, oracle

Solution

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;

Problem

How do I convert hexadecimal to decimal (and back again) using Oracle SQL?

Original source