S
S
Salabar2015-01-12 20:26:51
Oracle
Salabar, 2015-01-12 20:26:51

Update timestamp in oracle via odp.net. Because of what Invalid parameter?

There is a request:

const String SET_THE_LOT_SQL = @"update lots set bet = :bet, finishing_time = :finishing_time,  user_id = :user_id where lot_id = :currentLot";


OracleCommand set_lot_command = new OracleCommand(SET_THE_LOT_SQL, connection) { BindByName = true, CommandType = System.Data.CommandType.Text };
            set_lot_command.Parameters.Add(":bet", OracleDbType.Decimal).Value = bet;
            set_lot_command.Parameters.Add(":user_id", OracleDbType.Int32).Value = user_id;
            set_lot_command.Parameters.Add(":new_limit", OracleDbType.TimeStamp).Value = DateTime.Now;
            set_lot_command.Parameters.Add(":currentLot", OracleDbType.Int32).Value = lot_id;
            set_lot_command.ExecuteNonQuery();

:new_limit is actually a simple calculation, but that's not the point.

An exception is thrown on execute:

An unhandled exception of type 'System.ArgumentException' occurred in Oracle.ManagedDataAccess.dll

Additional information: Invalid parameter binding: finishing_time
The data type in the database itself is timestamp(6).

You can frankly score, in principle, but then not a single feature will remain in the coursework, you can say.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vapaamies, 2015-01-12
@vapaamies

Well, the parameter :finishing_timeis not set anywhere, although it is mentioned in the request text. The text of the error just hints at this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question