I'm working on case that allows the user to pass list of IDs and in background convert it into list of string, for instance '112456,450087' to '112456','450087' and it works but passing the final list to query returns no rows
Declare
IDLST varchar2(100);
resLST varchar2(100);
cnt number;
begin
IDLST:= '112345587, 45003421';
select ''''||replace(IDLST,',',''',''')||'''' into resLST from dual ;
DBMS_OUTPUT.PUT_LINE('OUTPUT ' || resLST );
select count(*) into cnt from TABLEX where IDnum in (resLST);
DBMS_OUTPUT.PUT_LINE('Result ' || cnt );
end;