How To:  replicate an xml file to table in database

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #17953
    Pallavik
    Keymaster

    Scenario:

    HVR 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 HVR’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 HVR’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

    1. Create capture and Integrate Actions

    Where testpallavi.xml is the name of the xml file

    1. Add the table test2 from the target location using Table Explorer. In this case the Target location is ‘orcl’.

    1. Do table Explorer in location ‘orcl’ and select table ‘test2’

    Step 4] Perform HVR 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 HVR’s xml format

    For more information please refer to the wiki page https://www.hvr-software.com/docs/FileFormat#HVR.27s_XML_Format

Viewing 1 post (of 1 total)
  • The forum ‘How to’ is closed to new topics and replies.

© 2020 HVR

Test drive Contact us