How to Bind Parameter by Position not by Name
Posted: Mon 07 Nov 2011 15:40
Hi,
We have SQL: update tmp t set t.f1 = t.f1+1 where t.f2=:p_f2 returning t.f1 into :p_f1
In ODP.Net, It is OK when we add parameter like this:
- cmd.Parameters.Add("p1"...).Value = 10;
- cmd.Parameters.Add("p2"...).Direction = ....ReturnValue;
But in DotConnect (5.2) we get ORA-01036 error. So that we have to add parameter with exact name:
- cmd.Parameters.Add("p_f2"...).Value = 10;
- cmd.Parameters.Add("p_f1"...).Direction = ....ReturnValue;
I think that, DotConnect check the binding name! For us, names is not important but positions!
How can we use the old way like in ODP.Net?
We are using VS2005 SP1
We have SQL: update tmp t set t.f1 = t.f1+1 where t.f2=:p_f2 returning t.f1 into :p_f1
In ODP.Net, It is OK when we add parameter like this:
- cmd.Parameters.Add("p1"...).Value = 10;
- cmd.Parameters.Add("p2"...).Direction = ....ReturnValue;
But in DotConnect (5.2) we get ORA-01036 error. So that we have to add parameter with exact name:
- cmd.Parameters.Add("p_f2"...).Value = 10;
- cmd.Parameters.Add("p_f1"...).Direction = ....ReturnValue;
I think that, DotConnect check the binding name! For us, names is not important but positions!
How can we use the old way like in ODP.Net?
We are using VS2005 SP1