Looks we do not understand each other. This is probably because english is not our native language
Sorry, if my post was misleading.
The problem was two fold:
1) working in Unicode mode 2) and supporting Raw column types
You wrote:
The Unicode mode and the Raw column types support are implemented. Look forward to the next build of dotConnect for Oracle.
So I decided
you have fixed both problems in this build:
dotConnect for Oracle 5.20 Beta is available now.
I downloaded it and tested:
Sorry, cannot see the difference. Doesn't work as before.
What I meant is that Unicode mode is not working properly. Here is an example:
Code: Select all
create table RAWTABLE
(
RAWCOLUMN RAW(16),
TEXTCOLUMN VARCHAR2(2000)
)
Code: Select all
using System;
using System.Text;
using Devart.Data.Oracle;
namespace ConsoleApplication1
{
class Program
{
static string testText = "Привет из Unicode // Hällö aus ünicode";
static Guid testGuid = Guid.NewGuid();
static void Main(string[] args)
{
Console.OutputEncoding = Encoding.UTF8;
using (var conn = new OracleConnection("User Id=scott;Password=tiger;Server=ora1020;Home=OraClient10g_home1;Unicode=True;"))
{
// OracleLoader requires open connection
conn.Open();
Console.WriteLine("Database parameters");
using (var command = conn.CreateCommand())
{
command.CommandText = "select parameter, value from nls_database_parameters";
using (var reader = command.ExecuteReader())
while (reader.Read())
Console.WriteLine("{0} = {1}", reader[0], reader[1]);
}
using (var command = conn.CreateCommand())
{
command.CommandText = "delete from rawtable";
command.ExecuteNonQuery();
}
Console.WriteLine("\nUsing Oracle Loader");
using (var loader = new OracleLoader("rawtable", conn))
{
loader.CreateColumns();
loader.Open();
loader.SetValue("textcolumn", testText);
loader.SetValue("rawcolumn", testGuid.ToByteArray());
loader.NextRow();
}
Console.WriteLine("Oracle Loader done");
Console.WriteLine("\nTesting Unicode string roundtrip");
// roundtrip string test
using (var command = conn.CreateCommand())
{
command.CommandText = "select :text from dual";
command.Parameters.AddWithValue("text", testText);
var str = (string)command.ExecuteScalar();
Console.WriteLine("test: {0}, result: {1}", testText, str);
Console.WriteLine("Test passed: {0}", str == testText);
}
Console.WriteLine("\nTesting Guid roundtrip");
// roundtrip guid test
try
{
using (var command = conn.CreateCommand())
{
command.CommandText = "select :guid from dual";
command.Parameters.AddWithValue("guid", testGuid);
var guid = (Guid)command.ExecuteScalar();
Console.WriteLine("test: {0}, result: {1}", testGuid, guid);
Console.WriteLine("Test passed: {0}", guid == testGuid);
}
}
catch (Exception e)
{
Console.WriteLine("Test failed: {0}", e.Message);
}
using (var command = conn.CreateCommand())
{
command.CommandText = "select textcolumn, rawcolumn from rawtable";
using (var reader = command.ExecuteReader())
while (reader.Read())
{
var str = reader.GetString(0);
Console.WriteLine("\nOracle loader: Unicode string");
Console.WriteLine("Test: {0}, result {1}", testText, str);
Console.WriteLine("Test passed: {0}", str == testText);
var guid = reader.GetGuid(1);
Console.WriteLine("\nOracle loader: Guid");
Console.WriteLine("Test: {0}, result {1}", testGuid, guid);
Console.WriteLine("Test passed: {0}", guid == testGuid);
}
}
Console.ReadLine();
}
}
}
}
And here what it displays on my console:
Code: Select all
Database parameters
NLS_LANGUAGE = ENGLISH
NLS_TERRITORY = UNITED KINGDOM
NLS_CURRENCY = #
NLS_ISO_CURRENCY = UNITED KINGDOM
NLS_NUMERIC_CHARACTERS = .,
NLS_CHARACTERSET = AL32UTF8
NLS_CALENDAR = GREGORIAN
NLS_DATE_FORMAT = DD-MON-RR
NLS_DATE_LANGUAGE = ENGLISH
NLS_SORT = BINARY
NLS_TIME_FORMAT = HH24.MI.SSXFF
NLS_TIMESTAMP_FORMAT = DD-MON-RR HH24.MI.SSXFF
NLS_TIME_TZ_FORMAT = HH24.MI.SSXFF TZR
NLS_TIMESTAMP_TZ_FORMAT = DD-MON-RR HH24.MI.SSXFF TZR
NLS_DUAL_CURRENCY = ?
NLS_COMP = BINARY
NLS_LENGTH_SEMANTICS = BYTE
NLS_NCHAR_CONV_EXCP = FALSE
NLS_NCHAR_CHARACTERSET = UTF8
NLS_RDBMS_VERSION = 10.2.0.3.0
Using Oracle Loader
Oracle Loader done
Testing Unicode string roundtrip
test: Привет из Unicode // Hällö aus ünicode, result: Привет из Unicode // Hällö aus ünicode
Test passed: True
Testing Guid roundtrip
Test failed: Value with type System.Guid not supported.
Oracle loader: Unicode string
Test: Привет из Unicode // Hällö aus ünicode, result @ 8 2 5 B 8 7 U n i c o d e / / H � l � a u s � n i c o d e
Test passed: False
Oracle loader: Guid
Test: cb0134bc-6745-4c75-8226-6a255b0f5ba6, result cb0134bc-6745-4c75-8226-6a255b0f5ba6
Test passed: True
Well done, raw types are now supported as you said.
But, as you may see, besides Guid is still being not a first class citizen in your drivers,
unicode string is not stored properly.
I hope with this kind of detalization you'll be able to reproduce and fix the problem. For test, I used latest downloadable Oracle 10g server with AL32UTF8 database encoding (as parameters show).
Thank you in advance,
Sincerely yours,
Alexey "Lex" Lavnikov