1 Reply Latest reply: Sep 27, 2012 10:42 AM by Jason_(A_Non) RSS

    XML file manipulation question

      I have to generate a big xml file from oracle relational tables, write the output to server and then load it back into a LOB field in the database.

      1) I am on Oracle version
      2) I am able to write the file to a server directory

      Is it possible to zip the xml file using oracle preprocessor , read it and then load it back into the database on demand?

        • 1. Re: XML file manipulation question
          Why not just store the XML in an XMLTYPE column in the DB. As you are on, you will be using the default storage format of SECUREFILE BINARY XML and that provides a compressed form of the XML that is easier for future parsing efforts. I can't speak how it would compare to a .zip version of the XML.

          Without knowing more why you think LOBs need to be involved, I would avoid them completely since they are not setup for efficient XML storage/usage and the XMLType datatype is.

          As for the .zip abilities, some good reference point (that started from)
          [url http://odieweblog.wordpress.com/2012/01/28/xml-db-events-reading-an-open-office-xml-document-xlsx/]XML DB Events : Reading an Open Office XML document (.xlsx)
          and eventually leads you to
          [url http://technology.amis.nl/2010/03/13/utl_compress-gzip-and-zlib/]Utl_compress, gzip and zlib
          [url http://technology.amis.nl/2010/06/09/parsing-a-microsoft-word-docx-and-unzip-zipfiles-with-plsql/]Parsing a Microsoft Word docx, and unzip zipfiles, with PL/SQL