Page 1 of 1

select delivers wrong rowid

Posted: Mon 12 Aug 2019 09:14
by Tobsel
On one of our customers database a select delivers the wrong rowid. The C# Code looks like this

var conn = new OracleConnection();
conn.Server = "1.1.1.1";
conn.Sid = "XXX";
conn.UserId = "xxx";
conn.Password = "xxx";
conn.Direct = true;
conn.Port = 1521;

conn.Open();
var dt = new DataTable();
var adp = new OracleDataAdapter("select smtp_server, rowid from ext_allgemein", conn);
adp.Fill(dt);

MyDataGrid.ItemsSource = dt.DefaultView;
conn.Close();
MyDataGrid.ItemsSource = dt.DefaultView;
conn.Close();

When I execute the select with the same user on PL/SQL-Developer the rowid is "AGsYahAAGAAAzirAAA". Executing the same select with the code above the rowid is "AAGsYahAAGAAAzirAAA". Just the "G" changes to an "A". We are sure that we are on the correct database because if we change the value of the "SMTP_SERVER" column with PL/SQL Developer to anything else it is also shown in the code (DataTable) above but the rowid is still wrong. We use this rowid for an update and got the invalid rowid exception. We can reproduce this only on one of our customers database. There is not other Table or View with the same name on the database etc.

DB-Version: 12.1.0.2.0
Devart Version: 9.7.734

Do you have any idea?

Re: select delivers wrong rowid

Posted: Mon 19 Aug 2019 15:31
by Shalex
Please run the code in a console application:

Code: Select all

    conn.Open();

    var cmd = conn.CreateCommand();
    cmd.CommandText = "select smtp_server, ROWIDTOCHAR(rowid) as string from ext_allgemein";
    var reader = cmd.ExecuteReader();
    while (reader.Read())
    {
        string id = (string)reader.GetValue("string");
        Console.WriteLine(id);
    }
    Console.ReadKey();
Are you getting a correct value (AGsYahAAGAAAzirAAA)?

Re: select delivers wrong rowid

Posted: Wed 11 Sep 2019 13:42
by Tobsel
Yes, it is correct now. It seems to be the "ROWIDTOCHAR(rowid)". But why? We have many running databases where this is not a problem with just selecting "rowid" in the select.

"select smtp_server, rowid from ext_allgemein" works in SQL-Plus Command Windows or PL/SQL-Developer without a problem.

Re: select delivers wrong rowid

Posted: Thu 12 Sep 2019 17:48
by Shalex
Please run the code in a console application without ROWIDTOCHAR:

Code: Select all

    conn.Open();

    var cmd = conn.CreateCommand();
    cmd.CommandText = "select smtp_server, rowid as string from ext_allgemein";
    var reader = cmd.ExecuteReader();
    while (reader.Read())
    {
        string id = (string)reader.GetValue("string");
        Console.WriteLine(id);
    }
    Console.ReadKey();
Are you getting a correct value (AGsYahAAGAAAzirAAA) without ROWIDTOCHAR?

Re: select delivers wrong rowid

Posted: Mon 16 Sep 2019 08:12
by Tobsel
Without the "ROWIDTOCHAR" I get the wrong value

Re: select delivers wrong rowid

Posted: Sat 05 Oct 2019 15:30
by Shalex
Please upgrade to v9.8.838, it includes the fix for a similar issue.

If the upgrade doesn't help, specify:

1) the full version of your Oracle Server (e.g.: "Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options")

2) are you using Devart.* .NET Framework assemblies (shipped with installation) or Devart .NET Standard assemblies (available via https://www.nuget.org/packages/devart.data.oracle)?