Page 1 of 1
6.70 beta and Unicode SQL
Posted: Thu 02 Oct 2008 16:54
by MarkF
Should unicode characters in the SQL query text work with D2009 and the 6.7 beta? I'm trying a simple "SELECT 'Some Unicode Text' FROM DUAL" query and it looks to be converting back to ansi text in the call to the server. Is it planned to support unicode query text, or am I missing a setting somewhere?
Thanks!
-Mark Ford
Benthic Software
Posted: Fri 03 Oct 2008 12:56
by Plash
We have added support for OCI Unicode Environment in ODAC 6.70. But it is disabled by default because OCI has some bugs with Unicode Environment.
You can enable it by setting the OCIUnicode global variable from the OraCall unit to True. In this case you must also set the UseUnicode option of TOraSession to True.
Posted: Fri 03 Oct 2008 16:25
by MarkF
Fantastic, Thanks! In my very quick and simple tests, it works perfectly. Will there be any documentation or information about the bugs that you hit? I'd definitely be interested in what to look out for.
-Mark
Posted: Mon 06 Oct 2008 09:37
by Plash
We'll add this information into the ODAC help.
Posted: Tue 14 Oct 2008 23:37
by puyopuy
Hi there,
I just download the trial version and try to test the Unicode support. I changed UseUnicode option of TOraSession to True but I don't know how to change OCIUnicode global variable. I try to update a table with Unicode characters but the result still return '???'.
Any help is much appreciated.
Thanks
puyo
Posted: Wed 15 Oct 2008 11:36
by Plash
Setting the OCIUnicode variable is required only to enable Unicode characters in text of SQL statements.If you enter Unicode characters in TDBGrid component, for example, setting the OCIUnicode variable is not required.
Please check that your database has UTF8 encoding, or you use NCHAR and NVARCHAR columns.
Posted: Wed 15 Oct 2008 12:08
by MarkF
Do you just need to know where that variable lives? If I remember correctly (I'm not at my D2009 test machine) the variable is in the OraCall unit. So you would use:
OraCall.OCIUnicode := True;
And add OraCall to your Uses list. I hope that helps!
-Mark
Posted: Thu 16 Oct 2008 05:27
by puyopuy
Thanks Plash and MarkF. I create the table using the following SQL
create table utable (id number(6),
name NVARCHAR2(100)
)
and I insert values using
insert into utable values (1, '閒話家常')
when I try to retrieve the result from TDBGrid/SQL Plus, it returns
ID NAME
================================
1 | ????
UseUnicode option of TOraSession set to True. Am I missed something?
Thanks
Posted: Thu 16 Oct 2008 09:11
by Plash
You need to set the OCIUnicode variable because you are using Unicode characters in the SQL property. Add OraCall unit to USES, and add the following code in the end of your unit:
Code: Select all
initialization
OCIUnicode := True;
end.
Posted: Fri 17 Oct 2008 03:19
by puyopuy
Thanks Plash, it's working fine now

Posted: Mon 20 Oct 2008 06:03
by puyopuy
My I ask ODAC 6.7.0 support Delphi 5?
Posted: Mon 20 Oct 2008 14:47
by Plash
We are planning to release the non-beta version of ODAC 6.70 this week. It will support Delphi 5.
Posted: Tue 21 Oct 2008 03:58
by puyopuy
Thanks Plash, waiting for ODAC 6.7 GA

Posted: Sun 26 Oct 2008 23:39
by puyopuy
Hi guys,
Is ODAC 6.7.0 for Delphi will have the same level support for Unicode in SQL? I tested in my D5 environment and I got "Full unicode support isn't found" error.
Thanks for the help.
Posted: Mon 27 Oct 2008 07:55
by Plash
Unicode in the SQL property is supported only for Delphi 2009 and in a special Unicode build for Delphi 2007.