Het probleem
Wat je nu doet, komt hierop neer:
select * from tableName where LOCATION_ID IN ('1,2,3');
Dat is één enkele string. Wat je nodig hebt is:
select * from tableName where LOCATION_ID IN (1,2,3);
De oplossing
select * from tableName
where LOCATION_ID in (
select regexp_substr(P_LOCATIONS, '[^,]+', 1, level)
from dual
connect by level <= length(regexp_replace(P_LOCATIONS, '[^,]*')) + 1
);
Zo splits je de komma-gescheiden string in afzonderlijke waarden. Werken je LOCATION_ID's als getal, dan kan een impliciete conversie volgen; veiliger is expliciet to_number(...) toevoegen als je zeker weet dat er alleen cijfers in de string staan.