Page 1 of 1

Major problem upgrading from 2.50 to 3.01

Posted: Thu 15 Sep 2005 08:22
by bejby7
Old code generated with version 2.50 is :

this.ocConstantsSelect.CommandType = System.Data.CommandType.StoredProcedure;
this.ocConstantsSelect.CommandText = "oxsystem.pkgconstants.selectrows:3";
this.ocConstantsSelect.Connection = this.oracleConnection1;
this.ocConstantsSelect.Name = "ocConstantsSelect";
this.ocConstantsSelect.Parameters.Add(new CoreLab.Oracle.OracleParameter("P_CONSTANT_NAME_FILTER", CoreLab.Oracle.OracleDbType.VarChar, 0, "CONSTANT_NAME_FILTER"));
this.ocConstantsSelect.Parameters.Add(new CoreLab.Oracle.OracleParameter("P_CUR", CoreLab.Oracle.OracleDbType.Cursor, 0, System.Data.ParameterDirection.Output, true, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));

Upgraded to 3.01 the code is changed and generated to this :

this.ocConstantsSelect.CommandText = "oxsystem.pkgconstants.selectrows:3";
this.ocConstantsSelect.CommandType = System.Data.CommandType.StoredProcedure;
this.ocConstantsSelect.Connection = this.oracleConnection1;
this.ocConstantsSelect.Name = "ocConstantsSelect";
this.ocConstantsSelect.Parameters.Add(new CoreLab.Oracle.OracleParameter("P_CONSTANT_NAME_FILTER", CoreLab.Oracle.OracleDbType.VarChar, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CONSTANT_NAME_FILTER", System.Data.DataRowVersion.Current, null));
this.ocConstantsSelect.Parameters.Add(new CoreLab.Oracle.OracleParameter("P_CUR", CoreLab.Oracle.OracleDbType.Cursor, 0, System.Data.ParameterDirection.Output, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));

This is done every time I check the command in designmode in .NET without any message to me. It has been done now for two weeks without our knowledge and has generated a lot of problems for us. We have to rollback two weeks of work for some parts of our project.

PLEASE HELP! WE HAVE A MESS IN OUR PROJECT BECAUSE OF THIS!!!

Posted: Thu 15 Sep 2005 09:26
by Paul
All code in "Windows Form Designer generated code" region is generated automatically by OraDirect .NET components and may be changed from version to version. We support compatibility of this code with new versions.

Posted: Thu 15 Sep 2005 14:29
by bejby7
Yes, I understand that.
But with 3.01 it don't work for us.

An Easy Example:

Starting a new C# project in .NET.
Adding an oracleconnection, setup properties for it and test the connection. Works fine!

Adding a oracleCommand and setup all properties to call a stored procedure against oracle with a cursor as out parameter, no input parameters.
In designmode for the oracleCommand I hit Execute.
Getting the error
"Index and length must refer to a location within the string.
Parameter name : length"

To do this with OraDirect 2.50 has never been a problem.

Posted: Fri 16 Sep 2005 06:49
by Paul
We cannot reproduce your problem with OraDirect .NET 3.01.2. We tried to call the next procedure in design time in OracleCommand Editor

Code: Select all

create or replace package DBX_DEMO_PACK is
  TYPE TCursor IS REF CURSOR;
  procedure Get_Dept(Cur OUT TCursor);
end;

/

create or replace package body DBX_DEMO_PACK
is
  procedure Get_Dept(Cur OUT TCursor)
  is
  begin
    OPEN Cur FOR
      SELECT *
      FROM Scott.Dept
      ORDER BY DeptNo;
  end;
end;
I can see another input parameter in your code "P_CONSTANT_NAME_FILTER".
Send us please small demo project to demonstrate the problem and include script to create server objects.

Posted: Fri 16 Sep 2005 10:40
by Paul
We reproduced your problem and fixed it. This fix will be included in the next OraDirect. NET build.