3 Replies Latest reply: Nov 23, 2012 7:59 AM by Marie123456 RSS

    Convert hexa to integer

    Marie123456
      Hello,

      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
      Marie
        • 1. Re: Convert hexa to integer
          Sutirtha Roy
          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
            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
              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.

              Marie