Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: HEX2DEC
In article <b7d19747.0208301545.186b3775_at_posting.google.com>,
dlimato_at_hotmail.com says...
>
>Was wondering how to convert hex to decimal in oracle. I see there is
>hextoraw, rawtohex, reftohex etc... but no hextodec or dectohex.
>
>I have a VARCHAR2 column that stores info in hex and I want to convert
>to decimal and later parse it.
>
>Thanks in advance,
ops$tkyte_at_ORA920.US.ORACLE.COM> select to_number( 'A0FF', 'xxxx' ) from dual;
TO_NUMBER('A0FF','XXXX')
41215
ops$tkyte_at_ORA920.US.ORACLE.COM> select to_char(41215,'XXXX' ) from dual;
TO_CH
ops$tkyte_at_ORA920.US.ORACLE.COM>
and if your on really old software that doesn't support the XX format, see
http://asktom.oracle.com/~tkyte/hexdec/index.html
-- Thomas Kyte (tkyte@oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Sat Aug 31 2002 - 10:41:51 CDT
![]() |
![]() |