i need to pick the count based on given parameter value in a function.function parameter value can be 'I' or 'D' or 'ALL'. 'ALL' means I and D both.
for ex:
create or replace function test1( FLAG in varchar2) return varchar2
as
b varchar2(20);
c varchar2(20);
begin
if flag='ALL'
then
c:='I','D';
else
c:=FLAG;
end if;
select count(*) into b from test where id=c;
return b;
end;
if i pass I or D its working fine.I want to pass 'ALL' as in parameter to pick all the count for both (I,D) but I am facing error.
Let me know if any other info required at my end.