1 Reply Latest reply on May 6, 2010 5:53 PM by gdarling - oracle

    Extracting data from long raw into varchar2

      I have a column in a table that is a LONG RAW It contains xml data that I am trying to extract into a text file or a varchar2 column. It is on 10.2. Which would be the best way?

      I have tried a:=utl_raw.cast_to_varchar2(b); spooled to a file but it extracts the data into singe byte chunks which is no good for properly formed XML

        • 1. Re: Extracting data from long raw into varchar2
          gdarling - oracle
          Well, thats kind of the problem when converting binary data to text. What do the bits represent? What encoding was used when you got the raw data from the text in the first place? 101010111101010101110101010 (to make something up) has a differnt meaning if you're talking ASCII vs UTF8 vs Chinese vs Hebrew.

          You may want to look into the UTL_I18N package, specifically the RAW_TO_CHAR and RAW_TO_NCHAR functions.

          Also, you're completely in the wrong forum here. You may want to post this in one of the database or NLS forums. Oracle Services for Microsoft Transaction Server is a forum for distributed transaction recovery from Windows clients.

          Hope it helps,