SQL issue with portuguese characters

SQL issue with portuguese characters

Postby WilkinsonDR » Thu 19 Jun 2014 19:45

Hello, i'm trying to make an insert command into a Oracle Database using dbExpress, but i'm having a issue with portuguese characters being replaced to "¿".

Can you help me?

[Information]
I'm using Delphi XE5 + Oracle 11g.

[SQL Connection Params]
SQLConnection.Params.Values[TDBXPropertyNames.Database] := '192.168.0.41:1521:ORCL';
SQLConnection.Params.Values[TDBXPropertyNames.VendorLib] := 'dbexpoda.dll';
SQLConnection.Params.Values[TDBXPropertyNames.LibraryName] := 'dbexpoda.dll';
SQLConnection.Params.Values[TDBXPropertyNames.GetDriverFunc] := 'getSQLDriverORADirect';
SQLConnection.Params.Values[TDBXPropertyNames.Role] := '';
SQLConnection.Params.Values[TDBXPropertyNames.UserName] := 'GIASSI';
SQLConnection.Params.Values[TDBXPropertyNames.Password] := 'dbaaccesskey';
SQLConnection.Params.Values['Trim Char'] := 'True';
SQLConnection.Params.Values['AutoCommit'] := 'False';
SQLConnection.Params.Values[TDBXPropertyNames.IsolationLevel] := 'Dirty Read';
SQLConnection.Params.Values['LongStrings'] := 'True';
SQLConnection.Params.Values['EnableBCD'] := 'True';
SQLConnection.Params.Values['CharSet'] := 'WE8ISO8859P1';
SQLConnection.Params.Values['ServerCharSet'] := 'WE8ISO8859P1';


[SQL]
CREATE TABLE TEST
(
DESCRIPTION VARCHAR2(100) NOT NULL
);


INSERT INTO TEST(DESCRIPTION)
VALUES ('Descrição')
WilkinsonDR
 
Posts: 2
Joined: Thu 19 Jun 2014 19:26

Re: SQL issue with portuguese characters

Postby AlexP » Fri 20 Jun 2014 11:24

To make such query work, you should set the UseUnicode option and UnicodeEnvironment to True:
Code: Select all
SQLConnection.Params.Values['UseUnicode'] := 'True';
SQLConnection.Params.Values['UnicodeEnvironment'] := 'True';
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: SQL issue with portuguese characters

Postby WilkinsonDR » Fri 20 Jun 2014 12:26

Thank you so much AlexP, it worked perfectly!

AlexP wrote:To make such query work, you should set the UseUnicode option and UnicodeEnvironment to True:
Code: Select all
SQLConnection.Params.Values['UseUnicode'] := 'True';
SQLConnection.Params.Values['UnicodeEnvironment'] := 'True';
WilkinsonDR
 
Posts: 2
Joined: Thu 19 Jun 2014 19:26

Re: SQL issue with portuguese characters

Postby AlexP » Fri 20 Jun 2014 12:48

You are welcome. Feel free to contact us if you have any further questions.
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35


Return to dbExpress driver for Oracle