Hello experts,
I have this following query that was taken from the link Listagg function excdding 4000 characters which @"Solomon Yakobson" wrote in 2013. I modified it a bit to highlight my problem with the query. Can someone tell me about it ? I mean is there any other way to do the same without the need for additional call for replace ?
select replace(rtrim(xmlagg(xmlelement(e,id,',').extract('//text()') order by id).GetClobVal(),','),''','''') as Correct_one,
rtrim(xmlagg(xmlelement(e,id,',').extract('//text()') order by id).GetClobVal(),',') as Wrong_one
from (select level||'''s' as id from dual connect by level < 10)
But the problem is I dont know what I get in my actual data for eg: '>' or '<' symbols. Then how do I dynamically replace it ?
Version:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
Regards,
Ranagal