Skip to Main Content

APEX

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 single comma delimited string into rows in Oracle Apex with where clause

hiddenonearthDec 7 2020 — edited Dec 7 2020

Hello,
currently I have to problem that when I'm splitting a comma seprated string into multiple rows my additional where clause doesn't fire. For example:
I have one comma string in one row with ('Emp1, Emp2, Emp3, Emp4') and
another column wih ('Emp1, Emp5, Emp6')
I want to select all the entries that Emp1 made for his projects. I managed to split the strings into multiple rows but I can't select the wished Emp.
My approach looks like this:
select distinct Project_Name, INITCAP(regexp_substr(replace(Team_members, '"', ''), '[^,]+', 1, level)) FROM Project_teams
where INITCAP(regexp_substr(replace(Team_members, '"', ''), '[^,]+', 1, level) ) = 'Emp Name'
connect by level <= regexp_count(TEAM_members, ',') + 1;
I also need this function as a filter for my series chart where I display the chart based on the teams. My approach is the same but with no result
Any help is appreciated.
Thank you.
P.S. Or this there a better solution on how store items with comma seprated values in a table? Picture for current insert mode for the teams item.
image.png

Comments
Post Details
Added on Dec 7 2020
13 comments
10,876 views