IT民工的生活
pentium1512
全部博文(10)
2011年(1)
2009年(2)
2008年(7)
gti307
hanyue92
leon916
wangyong
tsh185
分类: Oracle
2008-12-23 11:13:27
CREATE OR REPLACE TYPE type_split IS TABLE OF VARCHAR2 (4000)
第二,创建函数
create or replace function split(p_list varchar2,p_sep varchar2 := ',') return type_split pipelinedIS l_idx pls_integer; v_list varchar2(50) := p_list; begin loop l_idx := instr(v_list,p_sep); if l_idx > 0 then pipe row(substr(v_list,1,l_idx-1)); v_list := substr(v_list,l_idx+length(p_sep)); else pipe row(v_list); exit; end if; end loop; return; end split;
第三,调试
select * from table(split('aaa,bbb,ccc',','))
上一篇:一个简单的Oracle触发器例子
下一篇:sql server2005数据导入
登录 注册