How to load a nested xml file into database table ?
Tom
You can load an XML document into an XMLType, then query it, e.g.:
DECLARE
x XMLType := XMLType(
'
Tom
California
Los angeles
Jim
California
Los angeles
');
BEGIN
FOR r IN (
SELECT ExtractValue(Value(p),'/row/name/text()') as name
,ExtractValue(Value(p),'/row/Address/State/text()') as state
,ExtractValue(Value(p),'/row/Address/City/text()') as city
FROM TABLE(XMLSequence(Extract(x,'/person/row'))) p
) LOOP
-- do whatever you want with r.name, r.state, r.city
END LOOP;
END;