This discussion is archived
3 Replies Latest reply: Nov 23, 2012 5:59 AM by Marie123456 RSS

Convert hexa to integer

Marie123456 Newbie
Currently Being Moderated

I have a flat file in which I get a value in hexadecimal format.
Can we convert it in integer format in ODI ? I did'nt find anything about that.

Thanks in advance
  • 1. Re: Convert hexa to integer
    SutirthaRoy Guru
    Currently Being Moderated
    If your target is Oracle DB then do

    to_number(<source_column_name>, 'xx')

    and execute the mapping on staging area
  • 2. Re: Convert hexa to integer
    958953 Newbie
    Currently Being Moderated
    What is your target technology ?

    There are ways to do it. One of the way is to create function

    You can create ODI function to convert Hexadecimal to Integer.
    For example if you are using Oracle as your staging or target technology .. you can use

    Oracle you can use
    SYS_OP_RAWTONUM('AA') or to_number('AA', 'xx').

    Other can be directly using features of target or staging technologies to get the desired output.
  • 3. Re: Convert hexa to integer
    Marie123456 Newbie
    Currently Being Moderated
    Thank you both for you replies.

    The target is an XML file. I changed the staging area and I found the functions you both mentioned.

    I won't go into details but unfortunately this data isn't readable because finally it's not really hexadecimal. My problem lies elsewhere.

    However, I think your answers will be helpfull to others.



  • Correct Answers - 10 points
  • Helpful Answers - 5 points