各位大虾,小虾今天看到人家写的一个自定义的函数,如下:
function split(p_string varchar2,p_separator varchar2)
RETURN t_split_tbl PIPELINED-----PIPELINED关键字是什么意思?
is
v_str varchar2(4000):=p_string;
v_sep varchar2(50):=p_separator;
begin
while length(v_str)>0 loop
if(instr(v_str,v_sep)>0) then
pipe row(substr(v_str,1,instr(v_str,v_sep)-1));---- pipe row是什么意思? v_str:=substr(v_str,instr(v_str,v_sep)+1,length(v_str)-instr(v_str,v_sep));
else
pipe row(v_str);
v_str:='';
end if;
end loop;
end;请问下PIPELINED关键字是什么意思?pipe row是什么意思?
谢谢了
function split(p_string varchar2,p_separator varchar2)
RETURN t_split_tbl PIPELINED-----PIPELINED关键字是什么意思?
is
v_str varchar2(4000):=p_string;
v_sep varchar2(50):=p_separator;
begin
while length(v_str)>0 loop
if(instr(v_str,v_sep)>0) then
pipe row(substr(v_str,1,instr(v_str,v_sep)-1));---- pipe row是什么意思? v_str:=substr(v_str,instr(v_str,v_sep)+1,length(v_str)-instr(v_str,v_sep));
else
pipe row(v_str);
v_str:='';
end if;
end loop;
end;请问下PIPELINED关键字是什么意思?pipe row是什么意思?
谢谢了
pipelined声名此function是pipe的,如果这么声名了,就必须使用pipe row的方式把数据返回,常规函数最后的"return 变量",就变成了"return".pipelined的function主要是为了提高效率,不用等所有的数据都处理完成了才返回客户端,它是边处理边返回.适用于大数据量的交互.