Dear Sirs,
I think we found a bug within the .NET Oracle Provider (
System.Data.OracleClient ). When we try to update or
insert a varchar text into any oracle field with
characters like: "ė, č, ō, Ń, etc" the update fails. A
wrong character will be inserted.
Here is a code example:
System.Data.OracleClient.OracleConnection myConnection =
new System.Data.OracleClient.OracleConnection
("my connectionstring");
System.Data.OracleClient.OracleCommand myCommand =
myConnection.CreateCommand();
myCommand.CommandText =
"Update tablename set fieldname = " +
":myValue where id= :myID";
myCommand.Parameters.Add(":myValue",
System.Data.OracleClient.OracleType.VarChar,50);
myCommand.Parameters.Add(":myID",
System.Data.OracleClient.OracleType.Number);
myCommand.Parameters[":myValue"].Value = "My problėm.";
myCommand.Parameters[":myID"].Value = 10;
myCommand.ExecuteNonQuery();
The value "My problėm." will not be updated / inserted
correctly because of the ė character.
A work- around would be:
System.Data.OracleClient.OracleConnection myConnection =
new System.Data.OracleClient.OracleConnection(
"my connectionstring");
System.Data.OracleClient.OracleCommand myCommand =
myConnection.CreateCommand();
myCommand.CommandText = "Update tablename set fieldname
= 'My problėm' where id= 10";
myCommand.ExecuteNonQuery();
But if this is the only solution it would mean a lot of re-
programming for us to a worse situation.
I hope anyone has a better workaround or more information
about this issue.
Best regards,
Arjan Pottjewijd.
|