Page 1 of 1

Help!!! Trouble With SelectCommand.Parameters

Posted: Sun 12 Feb 2006 09:38
by DVE
Then first time call
QFunc.SelectCommand.Parameters["PStr"].Value := "xxxxxxxxxxxx";
QFunc.SelectCommand.ExecuteNonQuery();

Execute Oracle proc with value of parameter is "xxxxxxxxxxxx";

then call this proc with other value of parameter
QFunc.SelectCommand.Parameters["PStr"].Value := "F**K";
QFunc.SelectCommand.ExecuteNonQuery();

Execute Oracle proc with value of parameter is "F**Kxxxxxxxx";

WHY ??????????????????????????????????????????
Please explain this is a BUG or Fitches !

I can create parameters in RUNTIME, but i don't want it !!!

Posted: Mon 13 Feb 2006 10:09
by Paul
We cannot reproduce your problem with OraDirect .NET 3.20.7, Oracle server, client 9.2.0.4

Code: Select all

      oracleConnection1.Open();
      oracleCommand1.CommandText = "INOUT_PARAMS_PROC";
      oracleCommand1.CommandType = CommandType.StoredProcedure;
      oracleCommand1.Parameters.Clear();
      oracleCommand1.CreateParameters();

      ((OracleParameter)oracleCommand1.Parameters["varchar_p1"]).Value = "xxxxxxxxxxxx";
      oracleCommand1.ExecuteNonQuery();

      string s = (string)((OracleParameter)oracleCommand1.Parameters["varchar_p2"]).Value;
      
      ((OracleParameter)oracleCommand1.Parameters["varchar_p1"]).Value = "F**K";
      oracleCommand1.ExecuteNonQuery();

      s = (string)((OracleParameter)oracleCommand1.Parameters["varchar_p2"]).Value;
      GC.KeepAlive(s);

Code: Select all

CREATE OR REPLACE PROCEDURE          INOUT_PARAMS_PROC
(
  varchar_p1 IN OUT VARCHAR2,
  varchar_p2 IN OUT VARCHAR2
) IS
BEGIN
  varchar_p2 := varchar_p1;
END INOUT_PARAMS_PROC;
Send us please small demo project to demonstrate the problem to OdaDirect .NET support address and include script to create server objects.