Parsing XML file to insert into set of tables. Trigger or DBMS Job?
Hello,
I have a table with XMLType field XML_DATA_TABLE.
Something like:
<Document>
<Priority>5</Priority>
<State>2</State>
<Lines>
<Line>
<LineName>Line1</LineName>
<Fields>
<DocumentField>
<Name>Field1</Name>
<Value>3</Value>
</DocumentField>
<DocumentField>
<Name>Field2</Name>
<Value>Some_Text</Value>
</DocumentField>
</Fields>
</Line>
</Lines>
</Document>
XML contains an information that should be extracted into a set of connected tables.
For example, Documents, Lines, Fields, etc.
I have to process XML_DATA_TABLE table periodically to get new objects and insert them into appropriate tables. After processing xml the row should be deleted.
I think that a trigger on insert into XML_DATA_TABLE table is not a good idea in this case, because there should be some complicated logic of data extraction. I am going to create new DBMS job for this purpose.