I'm using .net 4.5.1, windows command line application using Oracle.DataAccess (ODP.NET) x86 2.122.1.0.
where tran
is a Oracle database transaction.
OracleCommand updCmd =
new OracleCommand("update mytable set price =0.5 where anseq = :p_id", tran.Connection);
updCmd.Transaction = tran;
updCmd.Parameters.Add("p_id", itemId);
var count= updCmd.ExecuteNonQuery();
count
==1
whereas:
OracleCommand updCmd =
new OracleCommand("update mytable set price =:p_price where anseq = :p_id", tran.Connection);
updCmd.Transaction = tran;
updCmd.Parameters.Add("p_id", itemId);
updCmd.Parameters.Add("p_price", 0.5);
var count= updCmd.ExecuteNonQuery();
count
==0
Even explicitly setting the parameter type:
updCmd.Parameters.Add(
new OracleParameter("p_price",
OracleDbType.Double,
22, System.Data.ParameterDirection.Input,
false, 16, 2, "myprice",
System.Data.DataRowVersion.Default, 0.5));
Results in no records updated.
Has anyone experienced this problem before or has idea what might be causing it?
TIA