Page 1 of 1

Unicode trouble (five days spent)

Posted: Fri 25 Mar 2005 17:17
by Serg Soorskih
Hello, Core Lob!

We use now ODAC VCL 4.5 and have to support Unicode in our database.

Database

create table BA_DOMAIN_STRING
(
Hello, Core Lob!

We use now ODAC VCL 4.5 and have to support Unicode in our database.

Database

create table BA_DOMAIN_STRING
(
CODE VARCHAR2(255) not null,
DOMAIN_CD VARCHAR2(255) not null,
LANG_CD VARCHAR2(10) not null,
NAME NVARCHAR2(500) not null
)

Oracle Server 9.2
Oracle Client 9.2

Code


Delphi 6.0

TOraSql.Text=
'INSERT INTO BA_DOMAIN_STRING
("CODE", "DOMAIN_CD", "LANG_CD", "NAME")
VALUES
(:"CODE", :"DOMAIN_CD", :"LANG_CD", :"NAME")'

TOraSession.Options.UseUnicode= true;
All parametrs have type ftWideString

I have tested
1) TOraSql.Params.Value=SomeWideString
2) TOraSql.Params.Value=SomeOleVariant
3) TOraSql.Params.AsWideString=SomeWideString
4) TOraQuery instead TOraSql
5) TOraLoader
6) Download trial version 5.50.0.16 for Delphi 6 and test on 1-4 it

All SomeWideStrings and SomeOleVariants I have wrote to text file (to debug).
It looks fine, but I see in field "Name" only "????????????" (upsided down) instead arabian chars.
My viewer works correct (it was checked on another non-delphi project).

What I have to do?
Or ODAC VCL does'nt support unicode and I have to try another solution?;)

Best Regards,
Serg Soorskih

Posted: Mon 28 Mar 2005 12:42
by Alex
Support for NCHAR types was added since ODAC 5.50.0.16 to use it properly you must set
TOraSql.Params.National := True; for params of national type.

Posted: Mon 28 Mar 2005 16:30
by Serg Soorskih
Thanks to Alex & Core Lab!

All works fine now.
If it is possible, explain please, why need set
Params.National=true, when Params.DataType=ftWideString?

Posted: Tue 29 Mar 2005 07:12
by Alex
The work with National Oracle types slightly differs from other types such as CHAR, VARCHAR and others so to determine that application works with National Oracle type you need to set National property to True.