There are no rows in the users table where user_id has the value '101,102,103'.
If you want to split a string into a set of separate values, you have to do a bit more than just use it in a not in expression.
Some possible approaches:
declare
p_csvlist varchar2(100) := '2002, 7369, 7499, 7902, 7934';
v_count integer;
begin
select count(*) into v_count
from emp e
where e.empno in
( select extractvalue(xt.column_value,'e')
from table(xmlsequence
( extract
( xmltype('<coll><e>' || replace(p_csvlist,',','</e><e>') || '</e></coll>')
, '/coll/*') )) xt );
dbms_output.put_line(v_count || ' rows');
end;
or this
declare
p_csvlist varchar2(100) := '2002, 7369, 7499, 7902, 7934';
v_count integer;
begin
select count(*) into v_count
from emp e
where e.empno in
( select regexp_substr(p_csvlist, '[^,]+',1,rownum)
from dual
connect by rownum <= length(p_csvlist) - length(replace(p_csvlist,',')) );
dbms_output.put_line(v_count || ' rows');
end;
or this (only works with numeric values):
declare
p_csvlist varchar2(100) := '2002, 7369, 7499, 7902, 7934';
v_count integer;
begin
select count(*) into v_count
from emp e
where e.empno in
( select to_number(xt.column_value)
from xmltable(p_csvlist) xt );
dbms_output.put_line(v_count || ' rows');
end;
Examples are from my FAQ article:
www.williamrobertson.net/documents/comma-separated.html
In clause doesn't work properlyIt works as it suppose to work. You are not passing a list of values to theinclause, you are passing just one value -'101,102,103'