René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

Loading an XML document (file) into XML DB

First, a table is needed to store the document.
create table xml_load (
  id  number primary key,
  doc XMLType
);
Then, a directory needs to be created that points the the location of the document to be loaded:
create directory xml_location as 'C:\xml';
Now, the document can be loaded:
insert into xml_load values (
  1,
  xmltype (
    bfilename('XML_LOCATION', 'hello.xml'),
    nls_charset_id('WE8ISO8859P1')
  )
);