Splitting comma seperated string without using Regular expressions
564035Sep 21 2012 — edited Jun 17 2013Hi,
I have a string that contains comma seperated values 'a,b,c,d,e'.
Is there a way to split these values without using regular expressions?
I know it can be done using regular expressions as follows:
WITH t AS
( SELECT 'a,b,c,d,e' AS txt FROM dual
)
SELECT CAST(REGEXP_SUBSTR (txt, '[^,]+', 1, level) AS CHAR(12))
FROM t
CONNECT BY level <= LENGTH(regexp_replace(txt,'[^,]*'))+1;
But the problem is that the software I will embed it into doesn't like the [^,] signs and removes them, and I cannot change this behaviour or escape it as a special character.
Thanks
AK