TField.Size wrong in XE10

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
fpicard
Posts: 2
Joined: Mon 27 Jun 2016 12:01

TField.Size wrong in XE10

Post by fpicard » Mon 27 Jun 2016 12:24

Hi,
I've ODAC 9.6.22 and Delphi XE10.
I've a table with a column like EMP_ID VARCHAR2(10).
I open a query on this table and MyQry.FieldAsString('EMP_ID').Size give me 40 not 10 !
XE10 is Unicode but I expect to have the right Oracle size. TDBEdit MaxLength is wrong too when a Dataset is associeted with the Qry !
Maybe it's OS dépendent ?

I've not this problem with Delphi XE6.

What can I do ?

thanks !

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

Re: TField.Size wrong in XE10

Post by AlexP » Mon 27 Jun 2016 13:19

Hello,

Since you are using a UniCode database and set the character type in a VARCHAR2 column as CHAR, then the real length of each character will be 4 bytes.
Therefore we increase the field length to a required number of bytes. In order not to increase the length, you should set the UseUnicode property to True, or the CharLength property to 1 (some problems may still occur).

fpicard
Posts: 2
Joined: Mon 27 Jun 2016 12:01

Re: TField.Size wrong in XE10

Post by fpicard » Mon 27 Jun 2016 13:38

Hello,

I set the CharLength to 1 and It's works fine now !

Thank you so much ;)

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

Re: TField.Size wrong in XE10

Post by AlexP » Mon 27 Jun 2016 13:56

Glad to see that the issue was resolved. If you have any further questions, feel free to contact us.

Post Reply