Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    5

    Question Unanswered: How to convert HEX to decimalist in Oracle?

    In table A there is one column named 'code',which type is VARCHAR2.It save a string like '1a000', actually it is a HEX number but save as string.So I want convert this string into a decimal number which can compare with another decimal number.finally I want ask how to convert HEX to decimalist in Oracle ,thank you very much !

    '1a000' ----> 106496

  2. #2
    Join Date
    Aug 2003
    Posts
    2
    Hi,

    try that:
    SELECT TO_NUMBER('1A000', 'xxxxxxxxxx') FROM dual;

    And on the reverse way:
    SELECT to_char(4555, 'xxxxxx') from dual;

    Have a good day

  3. #3
    Join Date
    Jul 2003
    Posts
    5
    Thank you very much! It's OK.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •