How to set OCI Unicode environment use in 9.2.5?

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

How to set OCI Unicode environment use in 9.2.5?

Post by MarkF » Thu 09 Jan 2014 15:25

It looks like the OraCall.OCIUnicode setting is no longer used (there's a note in the code about it being deprecated.) What's the new way to turn OCIUnicode on?

-Mark Ford
Benthic Software

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: How to set OCI Unicode environment use in 9.2.5?

Post by AlexP » Fri 10 Jan 2014 10:02

Hello,

This option is obsolete and left for backward compatibility. Now you should use the TOraSession.Options.UnicodeEnvironment property.

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

Re: How to set OCI Unicode environment use in 9.2.5?

Post by MarkF » Fri 10 Jan 2014 11:52

That was the first thing I tried but it doesn't appear to be hooked up. You can test it by running a query that has a unicode literal in it or by just putting a breakpoint in procedure TOCIEnvironment.Init and observing that the UnicodeEnv variable is never True (in my testing.)

-Mark
Benthic Software

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: How to set OCI Unicode environment use in 9.2.5?

Post by AlexP » Fri 10 Jan 2014 13:45

Hello,

Thank you for the information. We have reproduced and fixed the problem. This fix will be included to the next ODAC version. For the time being, to solve the problem, you should make the following changes in the TOraSession.GetOCIConnection method, the Ora.pas module:

After the line

Code: Select all

ConnectionParameters.UseUnicode := Options.UseUnicode;
add

Code: Select all

ConnectionParameters.UnicodeEnvironment := Options.UnicodeEnvironment;
And after

Code: Select all

Result.SetProp(prUseUnicode, Options.UseUnicode);
add

Code: Select all

Result.SetProp(prUnicodeEnvironment, Options.UnicodeEnvironment);

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

Re: How to set OCI Unicode environment use in 9.2.5?

Post by MarkF » Fri 10 Jan 2014 17:34

Thank you, that fixed the issue.

-Mark
Benthic Software

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: How to set OCI Unicode environment use in 9.2.5?

Post by AlexP » Sat 11 Jan 2014 09:56

Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.

RoniLev
Posts: 7
Joined: Sun 02 Mar 2014 21:04

Re: How to set OCI Unicode environment use in 9.2.5?

Post by RoniLev » Sun 02 Mar 2014 21:12

Hi there
I have the same problem.
I this problem solved in the last version on download page?

Oracle Data Access Components Standard 9.2.7 25-Feb-2014

Regards
Roni

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: How to set OCI Unicode environment use in 9.2.5?

Post by AlexP » Mon 03 Mar 2014 09:23

This problem is already fixed. Please download the latest ODAC version 9.2.7

angmar
Posts: 7
Joined: Wed 20 Jun 2007 09:03

Re: How to set OCI Unicode environment use in 9.2.5?

Post by angmar » Thu 06 Mar 2014 13:37

I have upgraded odac to 9.2.7 but this problem is going on for my project.
I could use turkish chars in sql text like "select 'öçşiğü' from dual" without problem.
After I passed to 9.2.5, I could not use these chars in sql correctly.
My code uncludes these lines:

Code: Select all

    myTOraSession.Options.UseUnicode := True;
    myTOraSession.Options.Charset := 'UTF8'
    OCIUnicode := True;
Also when I enable unicodeenvironment, I can not connect to oracle. I get a kind of chinese error :(
How I can I solve this ?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: How to set OCI Unicode environment use in 9.2.5?

Post by AlexP » Fri 07 Mar 2014 09:57

The OCIUnicode variable must be set before creating a TOraSession instance.

angmar
Posts: 7
Joined: Wed 20 Jun 2007 09:03

Re: How to set OCI Unicode environment use in 9.2.5?

Post by angmar » Fri 07 Mar 2014 12:38

OCIUnicode := True;
this code does not work whereever I write, I could not see turkish chars in sql in grid.
I am not glad for 9.2.7 version.
Unicodenvironment = true; does not work too.
It was working in previous versions and new solutions do not solve my problem.
Where am I wrong ?
when I downgrade to 9.1.4 and my problem is solved

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: How to set OCI Unicode environment use in 9.2.5?

Post by AlexP » Tue 11 Mar 2014 10:21

Please send me results of the following queries:

Code: Select all

SELECT USERENV ('language') from dual; 

SELECT * FROM V$NLS_PARAMETERS;

Post Reply