I do not even know where to start ... .net-ovsky program works with oracle. Named parameters are used to transfer data. Work has been going on for several years. once everything worked clearly, but now it was discovered that the names of the parameters do not matter, but their order has. tell me where to dig

accessing to stored procedures, parameters are passed as standard:

using (OracleCommand cmd = GetConnection().CreateCommand()) { cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.CommandText = "Owner.Package.Procedure"; OracleParameter p1 = new OracleParameter(); p1.OracleDbType = OracleDbType.Decimal; p1.Direction = ParameterDirection.Input; p1.ParameterName = "param1"; OracleParameter p2 = new OracleParameter(); p2.OracleDbType = OracleDbType.Decimal; p2.Direction = ParameterDirection.Input; p2.ParameterName = "param2"; cmd.Prepare(); cmd.ExecuteNonQuery(); } 

how it should be performed: when changing the order of parameters, everything should work correctly.

as it is now: if you swap the parameters in places (and their type is the same), the procedure will be executed, but with incorrect data.

  • Show the main sql query. Well, the code on s / s # that performs the request. If the sql query ? then order is important. - nick_n_a
  • @nick_n_a, yes c #, corrected tags - kvvk
  • @nick_n_a executes the stored procedure, the parameters are passed in the standard way - kvvk
  • You do not see the sql-code. Two points do not tell me anything. - nick_n_a
  • @nick_n_a there is no request there the name of the stored procedure is kvvk

1 answer 1

everything is simple, for this there is a special property

cmd.BindByName = true;