Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamic where clause for cursor

user523372Jun 28 2011 — edited Jun 29 2011
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 27 2011
Added on Jun 28 2011
10 comments
5,517 views