View Single Post

   
  #1 (permalink)  
Old 04-08-2008, 10:04 AM
liorlew@gmail.com
 
Posts: n/a
Default xmltype extract concatenates the results

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.

Reply With Quote