Example: Simple XML Import From Application Table

Previous Next

Here is an example of a simple XML import. This XML import processes the xml_document column for all records in the XML_IMPORTS table that have not been processed yet. The SELECT statement may retrieve zero or more records with an XML document to be processed:

INVOKE     XML.Import

WITH

SELECT     xml_document XmlDocument

FROM       xml_imports

WHERE      processed = 'N'

 

For example, suppose a record in the XML_IMPORTS table contains this xml_document:

<Persons>

    <PERSON ID="112" FAMILY_NAME="Smith" FIRST_NAME="John">

        <Update ID="112" FAMILY_NAME="Smith" FIRST_NAME="Johnny"/>

    </PERSON>

</Persons>

 

For this xml_document, the XML import method will update the corresponding PERSON record.