Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Split the row into multiple rows based on the delimiter but there are different delimiters for diffe

KVBFeb 21 2018 — edited Feb 22 2018

Hi All,

I have a scenario where the different rows has different delimiters ( space,colon,comma,semicolon). I can do it individually but looking for any possibility of giving all the delimiters at one

WITH TST(COL1) AS

(

SELECT 'ABC,123,XYZ' FROM DUAL

UNION

SELECT 'COLON1:COLON2:COLON3' FROM DUAL

UNION

SELECT 'SEMI1;SEMI2;SEMI3' FROM DUAL

)

SELECT REGEXP_SUBSTR(COL1,'[^,]+',1,LEVEL) FROM TST CONNECT BY LEVEL<=LENGTH(REGEXP_REPLACE(COL1,'[^,]+'))+1

Here I can separate only comma delimiter one's. How can i give the colon and semicolon delimiters?

Any pointers on this?

This post has been answered by mathguy on Feb 21 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 22 2018
Added on Feb 21 2018
21 comments
11,183 views