Link to home
Start Free TrialLog in
Avatar of pras_gupta
pras_gupta

asked on

Converting XML File to XMLTYPE

We are trying to load a XML text file to a Oracle XMLTYPE. Any suggestions on this would be really helpful.

Thanks in advance.
Avatar of Sujith
Sujith
Flag of United Kingdom of Great Britain and Northern Ireland image

You can use sqlloader to load your XMLs into your table.
The control file would look something like this.

---------------------------------------------
LOAD DATA
INFILE 'file_list.txt'
 APPEND INTO TABLE TBL1
 FIELDS TERMINATED BY ','
 (fname FILLER CHAR(10),
  val LOBFILE(fname) TERMINATED BY EOF)
---------------------------------------------

Where file_list.txt is a plain text file with the name of your xml documents.
For example the contents would look like:

one.xml
two.xml

Where one.xml and two.xml are the xml files to be loaded. and the column VAL is of XMLTYPE in your table.
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial