I have a small update query which works in SQL Developer.
UPDATE people
SET months = 8
WHERE number = 599
Fairly straight forward. And it works - this also works in C#. The problem is the moment I want to use Parameters (which works on number but not on months) it will stop working.
I have this code in C#:
using (OracleConnection con = new OracleConnection(connectionString))
{
con.Open();
OracleCommand command = con.CreateCommand();
command.CommandType = CommandType.Text;
command.CommandText = "UPDATE people " +
"SET months = :months " +
"WHERE number = :number";
command.Parameters.Add(":number", OracleDbType.Int32).Value = number;
command.Parameters.Add(":months", OracleDbType.Int32).Value = months;
command.ExecuteNonQuery();
}
They are both of type Number in oracle, and I've tried changing the OracleDbType to Decimal, and pretty much everything without success. The odd thing is, that the :number parameters works, but months doesn't get updated (it won't crash, it just doesn't update). However if i change the :months parameter, to a static value like 7 - it will work.