0
select regexp_substr('SMITH,ALLEN,WARD,JONES','[^,]+', 1, level)
from dual
connect by regexp_substr('SMITH,ALLEN,WARD,JONES', '[^,]+', 1, level) is not null;
Gary_W
  • 9,933
  • 1
  • 22
  • 40

1 Answers1

0

You didn't include the error, so we don't know which character is invalid. Here's a different version that does the same thing but handles NULL list elements. Since it does not contain a circumflex let's see if that's the culprit:

select regexp_substr('SMITH,ALLEN,WARD,JONES','(.*?)(,|$)', 1, level, NULL, 1)
from dual
connect by level <= regexp_count('SMITH,ALLEN,WARD,JONES', ',')+1;

Please let us know the results.

P.S. Don't use the regex format '[^,]+' to parse lists as it will return incorrect values if there are NULL list elements. See this post for explanation: https://stackoverflow.com/a/31464699/2543416

Community
  • 1
  • 1
Gary_W
  • 9,933
  • 1
  • 22
  • 40