Delphi 7 to Delphi 2010 Unicode migration

PeterP

Member
Hello,
as title says I'm trying to migrate my Delphi Oracle application from Delphi 7 to Delphi 2010 with unicode support.

As I allready figured out everything is working ok if I use queries using Variables, but a big part of my application uses direct SQL statements so there unicode doesn't work. If I give an example code, which doesn't work:

var Q: TOracleDataset;
UnicodeString: string;
begin
Q.Close;
Q.Sql.Text := 'SELECT * FROM MYTABLE WHERE MYCOL='''+UnicodeString+'''';
Q.Open;
end;
This code allways returns empty result.
As I figured out if I use unicode SQL in Oracle SqlDeveloper such SQL works ok, so it must be DirectOracleAccess components problem. Is there a way this to work, because transfering all SQL-s to work with Variables is very big problem for me.

Can anyone help me in any way?
 
As I mentioned earlier, I know that I can use Variables and it works ok, but application is Huge and code migration will take a lot of time and testing, which I can't afford right now.
 
What version of DOA are you using?
There should be a setting in (I think) the Session component for string conversion.
 
Thanks all I have resolved the issue by Oracle NLS_LANG setting to UTF8. Because I use Windows 7 64 bit and Oracle 11G 32 bit client I have been updating wrong registry value.
HKEY_LOCAL_MACHINE/Software/Wow6432Node and so on should be set.
 
Back
Top