Hi,
How to implement dynamic where clause in Informix Function?
Here is my code:
Create Function testFun(pv_dept integer)
RETURNING varchar(20), varchar(70);
Define lv_Name varchar(20);
Define lv_Details varchar(70);
FOREACH
Select name, details into lv_Name, lv_Details
from EMP where job='Manager'
-- have to add the following condition based on parameter
-- if parameter is null then display all
-- else display only that dept
and depet_no = pv_dept
return lv_Name, lv_Details WITH RESUME;
End FOREACH;
END FUNCTION;
Thank you