Oracle Unicode field size

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
martind1
Posts: 17
Joined: Mon 19 Oct 2009 05:15

Oracle Unicode field size

Post by martind1 » Sun 13 Nov 2011 19:42

we have an Oracle DB with NLS_CHARACTERSET = AL32UTF8
and set in SpecificOptions: UseUnicode = true

the problem is: when a field is declared as VARCHAR2(1 CHAR), the value of TWideStringField.Size is 4.

Is it possible to get the declared size in characters?
Better: set the 'correct' value to TWideStringField.Size

This would also fit the definition of TStringField in Delphi Help (ftString | Size is the maximum number of characters in the string).

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

Post by AlexP » Tue 15 Nov 2011 10:21

Hello,

If field is defined as VARCHAR2(X CHAR) in a database with the AL32UTF8 encoding, the maximum length of one symbol is 4, and that's why we set the maximum field size by default. If you want to change this value, you should change the CharLength parameter:

UniConnection1.SpecificOptions.Values['CharLength'] := 2;

Post Reply