Hi,
Below is the block which i am trying to test in scott schema. I dont want to substute IN clause values directly.
So i have written cursor and have added in separate variable separeated by comma.
But its not working.
declare
s varchar2(1000);
s1 varchar2(1000);
v number := 0;
v1 varchar2(2000) := 'SCOTT';
j number := 0;
cursor hh
is select ename from emp;
begin
select count(*) into v from emp;
for i in hh
loop
s := s||''''||i.ename||'''';
j := j+1;
if j <> v
then s := s||',';
end if;
s1 := s1||s;
s := null;
end loop;
dbms_output.put_line(S1);
case when v1 in (s1)
then dbms_output.put_line('Y'); else dbms_output.put_line('N');
end case;
end;
Please let me know is there any other way to solve this.
Thanks