oracle:
declare
xx varchar2(20):='1,2,3'||',';
type t_arr is varray(10) of varchar2(10);
v_arr t_arr:=t_arr();
begin
for i in 1..10 loop
if instr(xx,',',1,i)=0 then
exit;
end if;
v_arr.extend;
if i=1 then
v_arr(i):=substr(xx,1,instr(xx,',',1,i)-1);
end if;
v_arr(i):=substr(xx,1,instr(xx,',',1,i-1)+1,instr(xx,',',1,i)+1);
end loop;
end;
/