6.70 beta and Unicode SQL

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

6.70 beta and Unicode SQL

Post by MarkF » Thu 02 Oct 2008 16:54

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 03 Oct 2008 12:56

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.

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Post by MarkF » Fri 03 Oct 2008 16:25

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 06 Oct 2008 09:37

We'll add this information into the ODAC help.

puyopuy
Posts: 6
Joined: Tue 14 Oct 2008 23:30

Post by puyopuy » Tue 14 Oct 2008 23:37

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 15 Oct 2008 11:36

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.

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Post by MarkF » Wed 15 Oct 2008 12:08

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

puyopuy
Posts: 6
Joined: Tue 14 Oct 2008 23:30

Post by puyopuy » Thu 16 Oct 2008 05:27

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 16 Oct 2008 09:11

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.

puyopuy
Posts: 6
Joined: Tue 14 Oct 2008 23:30

Post by puyopuy » Fri 17 Oct 2008 03:19

Thanks Plash, it's working fine now :lol:

puyopuy
Posts: 6
Joined: Tue 14 Oct 2008 23:30

Post by puyopuy » Mon 20 Oct 2008 06:03

My I ask ODAC 6.7.0 support Delphi 5?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 20 Oct 2008 14:47

We are planning to release the non-beta version of ODAC 6.70 this week. It will support Delphi 5.

puyopuy
Posts: 6
Joined: Tue 14 Oct 2008 23:30

Post by puyopuy » Tue 21 Oct 2008 03:58

Thanks Plash, waiting for ODAC 6.7 GA :lol:

puyopuy
Posts: 6
Joined: Tue 14 Oct 2008 23:30

Post by puyopuy » Sun 26 Oct 2008 23:39

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.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 27 Oct 2008 07:55

Unicode in the SQL property is supported only for Delphi 2009 and in a special Unicode build for Delphi 2007.

Post Reply