0 Replies Latest reply: Feb 11, 2013 11:07 AM by 990435 RSS

    SQL Loader fails loading XML data enclosed by tag not found

    990435
      The problem I'm having is my XML tree doesn't contain all possible elements. In this example the second entry doesn't contain <age> - only the first entry will be added to the database

      Any idea of how I could solve this?

      The fields are saved as varchar2

      XML:

      <rowset>
      <row>
      <name>Name</name>
      <age>Age</age>
      <city>City</city>
      </row>
      <row>
      <name>Name2</name>
      <city>City2</city>
      </row>
      </rowset>
      .

      LOAD DATA
      INFILE 'data.xml' "str '</row>'"
      APPEND
      INTO TABLE test
      TRAILING NULLCOLS
      (
      dummy FILLER terminated BY "<row>",
      name ENCLOSED BY "<name>" AND "</name>",
      age ENCLOSED BY "<age>" AND "</age>",
      city ENCLOSED BY "<city>" AND "</city>"
      )