Function
Hi,
When i pass the modified IN parameter(vz) ( ie., adding the quotes to make it a string ) to the cursor, it is not working. But if i hardcode the same it will works
Am i missing something ??
function Func_one(px EMP.ID%type) return varchar2
AS
vx varchar2(200);
vy varchar2(200);
vz varchar2(200);
k varchar2(200);
x varchar2(200);
vz1 varchar2(200);
v_var varchar2(40);
cursor c1 (str in varchar2) is select ID from EMP where ID in (str);
begin
vy:= replace(px, ',' , ''',''');
vz:=ltrim(rtrim(''''||vy||'''')) ;
vz1:='';
for x in c1(vz)
loop
dbms_output.put_line('PERSONID: '||x.ID);
vz1:= vz1 ||','||x.ID;
end loop;
dbms_output.put_line('vz after for loop'||vz1);
return (vz1);
end;
------------------------------------------------------------------------
The most enjoyable things in the world are either Immoral or too Expensive or otherwise Inaccessible anyway