Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Delphi and Oracle: data type problem

Re: Delphi and Oracle: data type problem

From: Sergey Tavanets <ambiente_at_soft-review.kiev.ua>
Date: Thu, 1 Oct 98 15:22:24 +0200
Message-ID: <AAChNGb1pst@soft-review.kiev.ua>


÷ ÐÉÓØÍÅ ÏÔ ðÔ 25 ÓÅÎ 98 ÎÅËÔÏ
 (sheldon.wang_at_cdott.com) ÐÉÓÁÌ(Á/Ï):

> Thanks for your response.
>
> I did a test and found that Delphi BDE automatically determines how to
> convert data types.
>
> For Oracle table with field NUMBER(11) and greater (say, Number(12)....),
> Delphi translates the NUMBER(10)... to
> TFloatField. FOr Oracle Field NUMBER(10) and less ..., Delphi translates
> the NUMBER(10) to TIntegerField.
>
> It seems that it is arbitrary whether BDE translates a NUMBER into
> TFloatField or TIntegerField.
>
> Is there a place in Delphi where I can specify how to translate the NUMBER()
> from Oracle tables?

The reason why Delphi chooses TFloatField over TIntegerField is that TIntegerField can represent ONLY 4-byte Integers (natural Delphi Integer type). The maximal posible value for TIntegerField is 4294967295. If you look at this number you may notice it has exactly 10 digits which corresponds to number(10) in Oracle. Now if you have a column of number(n) type where n > 10 Delphi cannot handle such numbers using 4-byte integers the only way (for Delphi3) is to use floating point data types which allow more significant digits to be stored. Delphi4 introduced 8-byte Int64 type but it has no reflection for TField descendants.

Regards, Sergey.

P. S. The situation is slightly differnet with TParam class but the behaviour Delphi (or BDE) demonstrates is not quite clear for me. Received on Thu Oct 01 1998 - 08:22:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US