SQL> var list varchar2(200) SQL> exec :list := '2,4,6,8,10,34,33'; PL/SQL procedure successfully completed. SQL> select items.extract('/l/text()').getStringVal() item 2 from table(xmlSequence( 3 extract(XMLType('<all><l>'|| 4 replace(:list,',','</l><l>')||'</l></all>') 5 ,'/all/l'))) items; ITEM -------------------------------------------------------------------------------- 2 4 6 8 10 34 33 7 rows selected.Simple! Isn’t it?
Cheers, Paweł
3 comments:
Hey, clever indeed!
I've never put any attention to XML on Oracle, seems like I will be doing it from some time now on.
Thanks for sharing. I have included you on my blog list.
Hey Dude
your solution is Mind blowing.
I was breaking my head to solve this problem. your Idea is Awesome.
It's really cool.
Thanks, I can't say anything else.
Great!
Post a Comment