Migration Wizard problems

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
SLavaLL2
Posts: 5
Joined: Mon 04 Feb 2019 17:57

Migration Wizard problems

Post by SLavaLL2 » Mon 04 Feb 2019 18:19

Tried to migrate the project from Microsoft.Data.OracleClient to Devart dotConnect. I used the Migration Wizard. I was faced with the following problem - all Russian characters in the *.cs files were replaced by question characters, like this:

#region ��������� ����� ������������ �� ����������

In addition, Oracle Number type is mapped to System.Double type, although in Microsoft.Data.OracleClient it is mapped to the System.Decimal type.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Migration Wizard problems

Post by Pinturiccio » Thu 07 Feb 2019 14:18

We could not reproduce the issue. Please provide the following information:
1. Visual Studio version.
2. Project type (Console Ppplication, Win Forms, etc.).
3. Target .Net Framework of your project.
4. The example of files with region containing russian characters before migration and after migration.
5. If possible, archive your project and upload it to our ftp server (ftp://ftp.devart.com, credentials: anonymous/anonymous ) or to any file exchange server so that we could download it from there. And send us the password to the archive.
SLavaLL2 wrote:In addition, Oracle Number type is mapped to System.Double type, although in Microsoft.Data.OracleClient it is mapped to the System.Decimal type.
dotConnect for Oracle maps Oracle Number to different .NET types, depending on the precision and scale of the Number type in Oracle. It can be configured with NumberMappings. For more information about default number mapping, please refer to
https://www.devart.com/dotconnect/oracl ... pping.html
https://www.devart.com/dotconnect/oracl ... pings.html

SLavaLL2
Posts: 5
Joined: Mon 04 Feb 2019 17:57

Re: Migration Wizard problems

Post by SLavaLL2 » Mon 25 Feb 2019 15:08

The problem with files in win-1251 encoding.
UTF-8 files migtrated correctly

Examples can be downloaded here https://yadi.sk/d/tj5pe_FqsuAp8Q

1. Visual Studio 2012
2. Example - Console application, Real projects - WinForms, WinServices, Libraries...
3. .NetFramework 4.0 - 4.6.2
dotConnect for Oracle maps Oracle Number to different .NET types, depending on the precision and scale of the Number type in Oracle. It can be configured with NumberMappings. For more information about default number mapping, please refer to
https://www.devart.com/dotconnect/oracl ... pping.html
https://www.devart.com/dotconnect/oracl ... pings.html
I understand, by this behavior was unexpected.
ID number(12) i got as double.

Where else expect different behavior from the System.Data.OracleClient (Microsoft provider)?

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Migration Wizard problems

Post by Pinturiccio » Fri 01 Mar 2019 15:38

SLavaLL2 wrote:Examples can be downloaded here https://yadi.sk/d/tj5pe_FqsuAp8Q
We have reproduced the issue. We will investigate it and post here about the results as soon as possible.
SLavaLL2 wrote:Oracle Number type is mapped to System.Double type, although in Microsoft.Data.OracleClient it is mapped to the System.Decimal type.
You only need to change your connection string by adding the following parameter to it:
"Number Mappings=(Integer,11,18,System.Decimal);" - will map Number values, having precision from 11 to 18, to System.Decimal
For more information, please refer to
https://www.devart.com/dotconnect/oracl ... tring.html
https://www.devart.com/dotconnect/oracl ... rType.html
https://www.devart.com/dotconnect/oracl ... pings.html
SLavaLL2 wrote:Where else expect different behavior from the System.Data.OracleClient (Microsoft provider)?
You need to add the following line after migration:

Code: Select all

OracleUtils.OracleClientCompatible=true
It will return structures, specific for OracleClient, for some Oracle types.
For more information, please refer to https://www.devart.com/dotconnect/oracl ... ation.html

SLavaLL2
Posts: 5
Joined: Mon 04 Feb 2019 17:57

Re: Migration Wizard problems

Post by SLavaLL2 » Thu 21 Mar 2019 10:15

I have some places with code like this:

Code: Select all

        OracleParameter curs_param = new OracleParameter("P#CURSOR", OracleDbType.Cursor) 
          { Direction = ParameterDirection.Output };
        cmd.Parameters.Add(curs_param);        
        cmd.ExecuteNonQuery();
        OracleDataReader rdr = curs_param.Value as OracleDataReader;
This code works correctly with Microsoft provider.
And with Devart provider rdr is null, because param.Value is Devart.Data.Oracle.OracleCurstor type.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Migration Wizard problems

Post by Pinturiccio » Fri 22 Mar 2019 14:25

Replace the line:

Code: Select all

OracleDataReader rdr = curs_param.Value as OracleDataReader;
with the following one:

Code: Select all

OracleDataReader rdr = ((OracleCursor)curs_param.Value).GetDataReader();
For more information, please refer to https://www.devart.com/dotconnect/oracl ... ursor.html

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Migration Wizard problems

Post by Pinturiccio » Mon 25 Mar 2019 12:06

We have fixed the bug with corrupting not Latin-1 characters by Migration Wizard for files with non-unicode encoding. We will post here when the corresponding build of dotConnect for Oracle is available for download.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Migration Wizard problems

Post by Pinturiccio » Fri 29 Mar 2019 11:21

New build of dotConnect for Oracle 9.6.725 is available for download.
It can be downloaded from https://www.devart.com/dotconnect/oracle/download.html (trial version) or from Customer Portal (for users with valid subscription only).
For more information, please refer to viewtopic.php?t=38518

SLavaLL2
Posts: 5
Joined: Mon 04 Feb 2019 17:57

Re: Migration Wizard problems

Post by SLavaLL2 » Tue 16 Apr 2019 18:32

Another problem:
I have a stored procedure

Code: Select all

create or replace procedure user.aaa(p#date_start date)is
begin
  null;
end;
I called it from c#

Code: Select all

string server = "SERVER";
string user_name = "USER";
string password = "PASSWORD";
string connStr = "Persist Security Info=False;max pool size=1100;connection lifetime=3600;Number Mappings=((Integer,10,18,System.Int64),(Number,1,38,System.Decimal));User ID=" + user_name + ";Data Source=" + server + ";Password=" + password;
OracleConnection conn = new OracleConnection(connStr);
conn.Open();      
OracleCommand cmd = conn.CreateCommand();
cmd.CommandText = "USER.AAA(TO_DATE('20061222 17:27:08', 'yyyymmdd HH24:mi:ss'))";
cmd.CommandType = CommandType.StoredProcedure;
cmd.ExecuteNonQuery();
I got an error "ORA-01756: quoted string not properly terminated"

In SQL monitor I saw
BEGIN
AAA(TO_DATE('20061222 17;
END;
Error occurred: [1756] (ORA-01756: quoted string not properly terminated
)
Part of the time after the colon is lost
Version of code without time works correctly.

Code: Select all

cmd.CommandText = "USER.AAA(TO_DATE('20061222', 'yyyymmdd'))";

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Migration Wizard problems

Post by Pinturiccio » Sat 20 Apr 2019 15:05

We have reproduced the issue. We will investigate it and post here about the results as soon as possible.

SLavaLL2
Posts: 5
Joined: Mon 04 Feb 2019 17:57

Re: Migration Wizard problems

Post by SLavaLL2 » Wed 24 Apr 2019 12:33

I'm trying to get CLOB

Code: Select all

      OracleUtils.OracleClientCompatible = true;
      OracleConnection conn = new OracleConnection(connStr);
      conn.Open();
      OracleCommand cmd = conn.CreateCommand();
      cmd.CommandText = "select to_clob('111222') from dual";
      var rdr = cmd.ExecuteReader();
      rdr.Read();
      var lob = rdr.GetOracleLob(0);
The lob.Value is:
Image

If to set flag OracleUtils.OracleClientCompatible to false, the lob.Value is correct.
Image

How can I get correct lob.Value with OracleUtils.OracleClientCompatible = true?

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Migration Wizard problems

Post by Pinturiccio » Thu 25 Apr 2019 15:33

We have reproduced the issue. We will investigate it and post here about the results as soon as possible.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Migration Wizard problems

Post by Pinturiccio » Fri 26 Apr 2019 11:26

We have fixed the bug with executing OracleCommand, having CommandType.StoredProcedure, when its CommandText contains a colon, which does not denote a stored procedure overload number. We will post here when the corresponding build of dotConnect for Oracle is available for download.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Migration Wizard problems

Post by Pinturiccio » Wed 29 May 2019 13:16

We have also fixed the bug with reading CLOB data in the OracleUtils.OracleClientCompatible mode via the reader.GetOracleLob().Value and reader.GetOracleLob().Length properties and reader.GetOracleLob().Read() and reader.GetString() methods. We will post here when the corresponding build of dotConnect for Oracle is available for download.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Migration Wizard problems

Post by Pinturiccio » Fri 07 Jun 2019 08:43

New build of dotConnect for Oracle 9.7.770 is available for download.
It can be downloaded from https://www.devart.com/dotconnect/oracle/download.html (trial version) or from Devart Account (for users with valid subscription only).
For more information, please refer to viewtopic.php?t=38884

Post Reply