Subject | Re: [IBO] Rounding problem |
---|---|
Author | Daniel Rail |
Post date | 2005-04-20T11:41:25Z |
Hi,
At April 20, 2005, 04:32, Geoff Worboys wrote:
that it might be caught by IsCurrencyDataType. But, I have other
fields that are defined directly as NUMERIC(15,2) and Numeric(9,4),
and those two types get declared as TBCDField.
an attribute of BCD was assigned to the field, ftFloat is changed to
ftBCD.
application the field is declared as TFloatField or TBCDField.
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)
At April 20, 2005, 04:32, Geoff Worboys wrote:
>>> It seems likely to me that we are dealing with a field that isExperiment and database was created using Dialect 3.
>>> represented as a floating point. I have never really studied
>>> the AVG code to see what type it returns under various
>>> conditions. I suspect that the problem may be that TIB_Query
>>> is looking at the data type (NUMERIC(15,2)) and treating it as
>>> a scaled integer - whereas TIBOQuery is reading it as a
>>> floating point.
>> TIBOQuery reads it as a BCD, not as a floating point.
> Daniel,
> Where are you taking that from? (Experiment or assumption?)
> In the GetDataTypeAndSize function in IBODataset.pas there isI thought because I was using a CURRENCY domain name for the field,
> this code:
> if SQLScale <> 0 then
> begin
> NewDataType := ftFloat;
> case SQLType of
> SQL_FLOAT,
> SQL_FLOAT_,
> SQL_DOUBLE,
> SQL_DOUBLE_: ;
> else
> if IsCurrencyDataType then
> begin
> NewDataType := ftBCD;
> NewDataSize := -SQLScale;
> end;
> end;
that it might be caught by IsCurrencyDataType. But, I have other
fields that are defined directly as NUMERIC(15,2) and Numeric(9,4),
and those two types get declared as TBCDField.
> Notice that an SQLType of float or double will result in theBut, also if you look further down in that same method's code, that if
> NewDataType being returned as ftFloat.
an attribute of BCD was assigned to the field, ftFloat is changed to
ftBCD.
> If the database is dialect 1 (or was upgraded from dialect 1)At the moment, Riho is the only person to be able to confirm if in the
> then the underlying SQLType is probably double. So it appears
> to me that such instances will result in iboquery with ftFloat.
> Disclaimer: I have not setup any experiments to test all this.
> Just passing on my guesstimate that dialect 1 vs dialect 3
> issues could be confusing this situation. Hence the request
> for more information.
application the field is declared as TFloatField or TBCDField.
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)