Re: Help requiring loading XML data into MySQL v5.0
you should load each entity (in your case movie) in each row, not split by \n
LOAD DATA INFILE 'path.xml'
INTO TABLE `xyz`
FIELDS TERMINATED BY 'blablablabla' -- any nonexisting string
LINES TERMINATED BY '</movie>'
;
You can later create the field by
SELECT
EXTRACTVALUE(column1, '/movie/id') AS id,
EXTRACTVALUE(column1, '/movie/imdb_url') AS imdb_url,
EXTRACTVALUE(column1, '/movie/cast/actor[1]')
FROM xyz
;
Subject
Written By
Posted
November 14, 2008 11:14AM
Re: Help requiring loading XML data into MySQL v5.0
December 07, 2008 05:34PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.