Parameterized query in Oracle trouble
Although I can't see anything wrong with your example, I wonder if you're being hit by the old BindByName
problem. By default, ODP.NET binds parameters to the query in the order in which they are added to the collection, rather than based on their name as you'd like. Try setting BindByName
to true
on your OracleCommand
object and see if that fixes the problem.
I've had this problem so many times that I use my own factory method to create commands which automatically sets this property to true
for me.
Classic useless Oracle documentation here