v_source_string := substr(v_source_string,
v_separator_position + v_separator_length);
v_separator_position := instr(v_source_string, var_separator, 1);
v_count := v_count + 1;
if var_number = v_count then
v_result.delete;
v_result.extend; --数组添加一个空下标
v_result(v_result.last) := v_subset; --为数组最后一位赋值
return(v_result);
end if;
end loop;
return(v_result);
end f_split;
/*
测试代码:*/
declare
-- Local variables here
i integer;
results tabletype_varchar2;
begin
-- Test statements here
results:=f_split('01,02,03,04,05,06,07,', ',',7);
for i in 1 .. results.count loop
dbms_output.put_line(results(i));
end loop;
end;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12961536/viewspace-769587/
,如需转载,请注明出处,否则将追究法律责任。