procedure test_proc(p_list in varchar2)
is
begin
for r in (select items.extract('/l/text()').getStringVal() item
from table(xmlSequence(
extract(XMLType(''||
replace(cast (p_list as varchar2(4000)),
',',' ')||' ')
,'/all/l'))) items) loop
null;
end loop;
end;
It worked for me in all situations where I faced ORA-22905 on Oracle 10gR2 (10.2.0.3)
Paweł



3 comments:
Take a look at todays Laurent Schneider post. He uses the same xml construction for changing string to list of tokens.
Thank god I found this post. I have had a similar problem yesterday (it worked perfectly in sql but not in plsql) and I would probably never figure out I had to CAST the string as a varchar. I still don't understand why it actually works to be honest.
thank you very much for your post. it saved me quite a lot of time.
Post a Comment