NumArray
JG, February 04, 2002 - 3:45 am UTC
Excellet example as always
Simply Excellent
shankar, February 05, 2002 - 4:59 am UTC
Your code very useful besides being simple.Thanks
Oleksandr Alesinskyy, February 05, 2002 - 5:28 am UTC
What about Varchar2 type?
Hong, February 07, 2020 - 8:24 pm UTC
Help!! I have user pass in variable number of parameters(like department numbers) to function that I need to use in the where clause like "DeptID in (Deptlist)". I have:
create or replace type t_Dept as table of VARCHAR2(10);
create or replace function TestDept (Depts t_Dept) return Varchar2
as
DeptList Varchar2(250) :='';
begin
for n in 1..Depts.count
loop
if n=1 then
DeptList := Depts(n);
else
DeptList := DeptList || ''',''' ||Depts(n);
end if;
end loop;
if Depts.count>1 then
DeptList:='''' || DeptList || '''';
end if;
return DeptList;
End;
/
one parameter works, not more than 1.:
select * from tblDept where DeptID in (TestDept(t_Dept('590100'))); works
select * from tblDept where DeptID in (TestDept(t_Dept('590100', '590101'))); --Not working.
Maybe there are quotation being passed for character type?
February 10, 2020 - 4:19 am UTC
select * from tblDept where DeptID in (
select column_value from table(t_Dept('590100', '590101')));