xmloracle-databaseuploadsql-loader

Can Oracle SQL*Loader process XML?


Does Oracle offer a standardized upload of XML formatted files? I thought that the canonical format that is used for XML output, structure = ROWSET/ROW/columname, could be uploaded back into the table again, by just running sqlldr with appropriate control file contents.
But I cannot find anything about this anywhere on the web, and error messages after trials seem to indicate that it is only possible to upload XML into XML-type formatted tables, where I just want to upload data in a plain table but supply the data in XML format.


Solution

  • No, SQL*Loader can only process "flat" files.

    One option is to write an XSLT transformation that turns the ROWSET/ROW/column format into a text file and then import that into the target table.

    Another option is to import the XML into a single row, and then use Oracle's XML functions to select a relational result from that staging table and insert it into the real table.