-
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
-
You better use Tom Kyte's solution.
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|