Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> example: PIPELINED function
i posted this example in a cdo.misc in response to another question, but
thought it might be helpful to isolate it here:
create type vc4000tbl as table of varchar2(4000);
create or replace function as_table (
ip_arr in varchar2
)
return vc4000tbl pipelined
is
idx number default 1; dlen number default length(ip_arr); slen number; sep varchar2(1) default ',';
slen := instr(ip_arr,sep,idx); if slen = 0 then slen := dlen+1; end if;
pipe row (substr(ip_arr,idx,slen-idx));
idx := slen+1;
end loop;
return;
end as_table;
select column_value
from table (as_table('this,that,the other'))
Received on Fri Feb 06 2004 - 07:58:01 CST
![]() |
![]() |