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!

Another REGEXP question: how to extract multiple values from one string

MichaelR64Oct 26 2011 — edited Oct 27 2011
Hi, how do i extract multiple values from a string with RegExp constructs with Oracle SQL?

I have looked at the various examples but can not figure this out .
the following Sql
select
   regexp_substr(sessie."rollen", 'CN=A_role') "A_role"
   from ( 
select '
CN=A_role,OU=a_org_unit,OU=another_org_unit,DC=bz,DC=ad,DC=min,DC=local
CN=Another_role,OU=some_org_unit,DC=bz,DC=ad,DC=min,DC=local
CN=Users,OU=Dep,DC=bz,DC=ad,DC=min,DC=local
'   "rollen" from dual
) sessie;
just returns CN=A_role.
I want it to return all of the CN= values concatenated with a semicolon and stripped from the CN= bit.
So: A_role;Another_role;Users .

Any help would be deeply appreciated. I am using 11g 11.2.0.2.0 database here.

Does anybody have any idea how to do this in SQL ?

kind regards Mike
This post has been answered by AndreyN on Oct 26 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 24 2011
Added on Oct 26 2011
6 comments
2,386 views