Please .... check the link we sent
https://asktom.oracle.com/pls/asktom/asktom.search?tag=separating-comma-separated-words That is what *I* did....
a) clicked on the link
b) read down through the content, picking up lots of useful knowledge
c) found an entry that actually said almost EXACTLY what your question was asking:
"SQL Tokenizer + connect by, ...Version using regexp_substr"
followed by
"Version using plain substr (less elagant but more performant)"
So someone had REGEXP version which they converted to just SUBSTR/INSTR....
SQL> select substr (x,
2 instr (x, ',', 1, level ) + 1,
3 instr (x, ',', 1, level+1) - instr (x, ',', 1, level) -1 )
4 as token
5 from (select ','||'V6A 0E5,V6A 4H2,V6A 0C7,V6A 4E1,V6A 0A5'||',' as x from dual)
6 connect by instr (x, ',', 1, level+1) > 0
7 ;
TOKEN
----------------------------------------------------------------------------------------
V6A 0E5
V6A 4H2
V6A 0C7
V6A 4E1
V6A 0A5
My advice to anyone - the Cut/Paste mind-set without endeavouring to understand isn't the path to being a great developer.