Using an IN Clause in a Stored Procedure
850978Apr 25 2011 — edited May 10 2011Hello All:
I have come to the conclusion that my stored procedure is having a problem with the use of an IN clause using a parameterized query.
I have in my Stored Procedure the following: AND oh.status_flag IN (p_OrderStatus)
The p_OrderStatus will contain values along the lines of:
1). p_OrderStatus = 'X'
2). p_OrderStatus = 'X', 'S', 'W'
In my .Net code, I am setting the parameter value as being:
oCommand.Parameters.Add("p_OrderStatus", OracleDbType.Varchar2).Value = Status;
However: this isn't working as something in the IN clause doesn't seem to work as I expected, but if I do the same query through a TORA window, it brings back values.
What is causing this to stop working once I move it to a Stored Procedure and how do I fix it (either the .Net side or the Oracle Side, which I assume it would be something on the Oracle side of things).
Any help is greatly appreciated
Thanks
Andy