Can anyone tell me (or point me to an online resource) how to load a small XML file into an Oracle table? I need to have a nightly process that picks up and loads a file.
Do you want to just load the whole file en-masse into a column in a table or actually parse the xml and extract the individual bits and load these into several columns that correspond to the XML nodes/attributes
$ type xml_test.xml
load data
infile *
into table xml_test
append
fields
(
ext_fname filler char(80),
xml_data lobfile(ext_fname) terminated by EOF)
begindata
xml_test.xml
$
$ sqlloader capel/james control=tom
SQL*Loader: Release 9.2.0.2.0 - Production on Thu Oct 26 15:56:32 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Commit point reached - logical record count 1
$
$
$
Lets see if its there
$ sqlplus db/pw
SQL>
SQL> set long 100000
SQL> set longchunksize 100000
SQL> col xml_data form a60
SQL> set pages 0
SQL> select xml_data from xml_test;
<emp>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.