Oracle 在PL/SQL将字符串分割输出
示例如下:
declare
begin
for maina in (select tt.line ll
from (select regexp_substr('a,b,c,d', '[^,]+',1,level) line
from dual bd
connect by level <= regexp_count('a,b,c,d', ',') + 1) tt
where rownum <= regexp_count('a,b,c,d', ',') + 1)loop
dbms_output.put_line('分割后的字符:' || maina.ll);
end loop;
end;
结果: