Dynamic where clause for cursor
Hi Friends,
I have a stored procedure with a single input parameter where in the input comes as
a string of values (ex: EMPLOYEE NAMES) separated by commas. I use this parameter in my cursor query
and my requirement is like when the parameter is NULL the query has to run for ALL the employees but if
its not, it has to run for the EMPLOYEE NAMES passed as the input parameter.
What are the possible and apt solutions for this requirement ?
Should I go for dynamic sql or do I have any other optimal solutions?
Please advice me.
Thanks
Zara