How To: Replicate an xml file to table in database
Scenario:
Local Data Processing tool can be used to replicate the xml file format to a table in a database. But to achieve this it is required that the xml file is present in Local Data Processing's xml format.
Pre-requisites:
1] The location for Target database is already created
2] The location for file source is already created
Steps:
Step 1] Create a table on the Target database.
Step 2] Create the xml file with below Local Data Processing's xml format.
<?xml version="1.0″ encoding="UTF-8″?>
<!DOCTYPE hvr SYSTEM "lib/hvr.dtd">
<hvr version="1.0″>
<table name="test2″>
<row>
<column name="c1″>1</column>
<column name="c2″>Hello</column>
</row>
<row>
<column name="c1″>2</column>
<column name="c2″>Hello World</column>
</row>
</table>
</hvr>
Here c1 and c2 are the column names and test2 is the table name. It should be same as the name of the table in the Target location.
Step 3] Create the channel
A] Create capture and Integrate Actions
Where testpallavi.xml is the name of the xml file
B] Add the table test2 from the target location using Table Explorer. In this case the Target location is 'orcl'.
C] Do table Explorer in location 'orcl' and select table 'test2'
Step 4] Perform initialize for this channel. This will create capture and Integrate jobs
Step 5] Start the Capture and Integrate Jobs.
Step 6] Below is the contents of the table in Target oracle location
Please note that
- Refresh is not supported for file class
- If the xml files are huge , then XSLT can be used to convert them to Local Data Processing's xml format
For more information please refer to the wiki page https://www.hvr-software.com/docs/actions/fileformat