Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> xmltype extract concatenates the results

xmltype extract concatenates the results

From: <liorlew_at_gmail.com>
Date: 24 Mar 2006 16:05:11 -0800
Message-ID: <1143245111.727430.6840@i40g2000cwc.googlegroups.com>


Hello all,

I have a problem using XMLTYPE in the case that I have multiple tags with the same name. example:
<tag1>

<tag2>str1</tag2>
<tag2>str2</tag2>
<tag2>str3</tag2>
<tag2>str4</tag2>

</tag1>

when I use the following query:
select (xmltype(val)).extract('/tag1/tag2/text()).getStringVal() from myTable;

I get the following:
str1str2str3str4

My question is, is there a method to get the data in multiple rows or separated by a delimiter.

str1
str2
str3
str4

or: str1#str2#str3#str4

I am using oracle 9i and the data is stored in a clob column of a table. Received on Fri Mar 24 2006 - 18:05:11 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US