Can anyone please help me to split the following string
'Column1, To_date(Column2, 'DD/MM/YYYY'), Column3'
into
COLUMN_LIST
Column1
To_date(Column2, 'DD/MM/YYYY')
Column3
in oracle
Can anyone please help me to split the following string
'Column1, To_date(Column2, 'DD/MM/YYYY'), Column3'
into
COLUMN_LIST
Column1
To_date(Column2, 'DD/MM/YYYY')
Column3
in oracle
SELECT TRIM(regexp_substr(a.text, a.regExp, 1, level, null, 2)) names
FROM (SELECT 'Column1, to_date(Column2, ''DD/MM/YYYY''), Column3, TO_NUMBER(''123'', ''999''), Column4,Column5' text
, '(^|,)(([^,]*\([^\(\)]*\))|[^\(\),]*)' regExp
FROM dual) a
CONNECT BY regexp_substr(a.text, regExp, 1, level, null, 2) is not null
result is:
Column1
to_date(Column2, 'DD/MM/YYYY')
Column3
TO_NUMBER('123', '999')
Column4
Column5
I hope this is what you needed :)