Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> how does a pl/sql function handle an 'IN' list operator as a parameter
I want to use the folowing query inside a pl/sql function or procedure and return a resultset or recordset. The challenging part I'm finding out is how to supply the IN List as a parameter . Any ideas ? Thanks.
select * from emp where empname IN ('smith','john','white','jake')
of course, the in list can contain anything from 1 value to 100 values. The values are only known at runtime.
eg
create or replace function doThis(param1 in varcahr2) return
ref_cursor_type
as
c1 is ref_cursor_type;
begin
open c1 as select * from emp where empname IN (param1);
return c1;
end;
Thanks for any feedback. Received on Tue May 29 2001 - 05:01:52 CDT