日期:2014-05-17 浏览次数:21094 次
--Oracle 10g:
begin
for var in (
with tab as(
select '45,23,1544,666,48,24' num from dual
)
select regexp_substr(num,'[^,]+',1,level) num from tab
connect by
level<=length(num)-length(replace(num,',',''))+1
)
loop
--do something
dbms_output.put_line(var.num) ;
end loop;
end;
PL/SQL block, executed in 0 sec.
45
23
1544
666
48
24
Total execution time 0.016 sec.
------解决方案--------------------
可以借助oracle的对象类型,建立内部类型