逗号分隔的字符串转换为行数据(collection)
2016-12-03 13:38
477 查看
逗号分隔的字符串转换为行数据(collection) CREATE OR REPLACE FUNCTION "GET_STR_TAB" (v_str in varchar2) return table_str pipelined as v_new_str varchar2(8000); begin if v_str is null then pipe row(-1); else v_new_str:=replace(replace(v_str,chr(10),''),chr(9),''); while 1=1 loop if instr(v_new_str,',')=0 then pipe row(to_number(v_new_str)); exit; else pipe row(to_number(substr(v_new_str,1,instr(v_new_str,',')-1))); v_new_str:=substr(v_new_str,instr(v_new_str,',')+1); end if; end loop; end if; return; end; 另还要有一个type类型 CREATE OR REPLACE TYPE "TABLE_STR" as table of number
相关文章推荐
- 逗号分隔的字符串转换为行数据(collection)(续)
- [原创]SQL表值函数:把用逗号分隔的字符串转换成表格数据
- Oracle将以逗号分隔的数字字符串根据字典表转换为中文字符串
- SQL转换列为以逗号分隔的字符串
- 从textarea中空格、逗号、换行转换为逗号分隔的字符串 js string.split
- 把数组转换为一个用逗号分隔的字符串
- 【第5篇】使用json-lib把json字符串数据转换成Collection
- 将以逗号分隔的字符串转换成字符串数组
- 逗号分隔字符串转换为一张表--解决查询in(逗号分隔字符串)出错问题
- 把数组转换为一个用逗号分隔的字符串
- MSSQL将逗号分隔的字符串转换成列显示
- 转换字符串的字符成单个字符并用逗号分隔
- .net去除逗号分隔的字符串中的重复数据
- 如何把一个逗号分隔的字符串转换成数组 并且倒序输出
- sql将列转换为以逗号分隔的字符串
- 将List中的数据组成用逗号分隔的字符串,如'a','b','c'
- 把某一列值转换为逗号分隔字符串
- 把一个逗号分隔的字符串转换为一个字符串数组
- SQL Server将表的一列转换成逗号分隔的字符串
- 把某一个用逗号或者/或者其他符号作为间隔的字符串分隔成一张表数据。