balachandar
Programmer
Hi All,
I have developed a new stored procedure. Wherein I have the following where clause
Where emp_id in (iparameter)
Actually there can be multiple values here
i.e.
Where emp_id in(‘100’,’121’’133’)
Moreover, the number of such values is not known. Hence, I am passing a big string
‘100’,’110’,’121’ to the stored procedure as a parameter iparameter and use it in the where clause.
However, it is not working in the way as I expected. If I hard code those values, the procedure works correctly. This is a temporary fix and not a permanent solution, Hence I would like to know from you the solution for this problem. Why If I pass a parameter to an “IN” clause, it is not working correctly.
Else what is the way I can build a dynamic “IN” clause. Give me the best solution.
Thanks and Regards
Balachandar Ganesan.
I have developed a new stored procedure. Wherein I have the following where clause
Where emp_id in (iparameter)
Actually there can be multiple values here
i.e.
Where emp_id in(‘100’,’121’’133’)
Moreover, the number of such values is not known. Hence, I am passing a big string
‘100’,’110’,’121’ to the stored procedure as a parameter iparameter and use it in the where clause.
However, it is not working in the way as I expected. If I hard code those values, the procedure works correctly. This is a temporary fix and not a permanent solution, Hence I would like to know from you the solution for this problem. Why If I pass a parameter to an “IN” clause, it is not working correctly.
Else what is the way I can build a dynamic “IN” clause. Give me the best solution.
Thanks and Regards
Balachandar Ganesan.