oracle怎么用函数求一个存储过程的输入参数(是一个以,为分隔的字符串)的长度~! 急,不胜感激!
2个回答
展开全部
select substr(',' || a.exc,
instr(',' || a.exc, ',', 1, b.rn) + 1,
instr(a.exc || ',', ',', 1, b.rn) -
instr(',' || a.exc, ',', 1, b.rn)) exc
from (select 'a,b,c,d,e,f,g,h' exc from dual t) A,
(SELECT ROWNUM RN FROM DUAL CONNECT BY ROWNUM < 20) B
where length(a.exc) - length(replace(a.exc, ',')) + 1 >= b.rn
instr(',' || a.exc, ',', 1, b.rn) + 1,
instr(a.exc || ',', ',', 1, b.rn) -
instr(',' || a.exc, ',', 1, b.rn)) exc
from (select 'a,b,c,d,e,f,g,h' exc from dual t) A,
(SELECT ROWNUM RN FROM DUAL CONNECT BY ROWNUM < 20) B
where length(a.exc) - length(replace(a.exc, ',')) + 1 >= b.rn
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询