|
-
Hi,
If you have a table containing at least as many records as the input values, you can use the following query
Code:
select substr(:x,begin,end-begin)
from (select pos+1 begin,nvl(lead(pos) over (order by pos),length(:x)+1) end
from (select instr(:x,',',1,rownum) pos
from dba_objects)
where rownum <= length(:x)-length(replace(:x,','))+1
);
SQL> exec :x := 'a,b,c,d,e,f,g,h'
PL/SQL-procedure is geslaagd.
SQL> select substr(:x,begin,end-begin)
2 from (select pos+1 begin,nvl(lead(pos) over (order by pos),length(:x)+1) end
3 from (select instr(:x,',',1,rownum) pos
4 from dba_objects)
5 where rownum <= length(:x)-length(replace(:x,','))+1
6 );
SUBSTR(:X,BEGIN,END-BEGIN)
--------------------------------------------------------------------------------
a
b
c
d
e
f
g
h
8 rijen zijn geselecteerd.
Regards,
Arian
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|