Import XML file in Oracle XML DB Repository

2019-06-11 06:33发布

问题:

I am new to XML databases. I have the following XML file (employees.xml) :-

<?xml version="1.0"?>
<emps>
    <emp empno="1" deptno="10" ename="John"  salary="21000"/>
    <emp empno="2" deptno="10" ename="Jack" salary="310000"/>
    <emp empno="3" deptno="20" ename="Jill" salary="100001"/>
</emps>

I want to load it in my Oracle XML DB Repository (under "public" folder) so that I can access it later using XQJ. Oracle is locally installed in my machine. Any clues how to import the XML file ?

回答1:

The various technologies for loading XML Data into the tables are documented here.

Basically use the lobfile function in SQLLoader to get the file as a whole and insert it into your XML column.