欢迎各位兄弟 发布技术文章
这里的技术是共享的
create or replace function my_split(piv_str in varchar2, piv_delimiter in varchar2)
--piv_str 为字符串,piv_delimiter 为分隔符
return split_type is
j int := 0;
i int := 1;
len int := 0;
len1 int := 0;
str varchar2(4000);
my_split split_type := split_type();
begin
len := length(piv_str);
len1 := length(piv_delimiter);
while j < len loop
j := instr(piv_str, piv_delimiter, i);
if j = 0 then
j := len;
str := substr(piv_str, i);
my_split.extend;
my_split(my_split.count) := str;
if i >= len then
exit;---------------------------------------------------------》plsql 中跳出循环的语句和java中的break语句同意
end if;
else
str := substr(piv_str, i, j - i);
i := j + len1;
my_split.extend;
my_split(my_split.count) := str;
end if;
end loop;
return my_split;
end my_split;
来自 https://blog.csdn.net/zy103118/article/details/86305714
来自 https://blog.csdn.net/weixin_36143786/article/details/116396150