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?
select delivers wrong rowid
Re: select delivers wrong rowid
Please run the code in a console application:
Are you getting a correct value (AGsYahAAGAAAzirAAA)?
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();
Re: select delivers wrong rowid
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.
"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
Please run the code in a console application without ROWIDTOCHAR:
Are you getting a correct value (AGsYahAAGAAAzirAAA) 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();
Re: select delivers wrong rowid
Without the "ROWIDTOCHAR" I get the wrong value
Re: select delivers wrong rowid
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)?
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)?