Subject Re: [IBO] Is CURRENCY field column attributes ignored?
Author Geoff Worboys
> Reading IB6 Data definition guide, you discover that,
> for IBO6 and above, numeric data are ALWAYS stored as
> integer. The precision determinates if INTEGER or
> INT64 is used. Since IBO knows about data byte
> occupation in the database (SQLSize, or something like
> that), EVERY numeric() must be stored as integer.

Its actually the SQLType that is used (SQL_SHORT, SQL_LONG, SQL_INT64
etc). IBO is already handling the situation in this regard.

> So there should be a code like:
> tmpINT64 := CurrencyFieldValue * (Power10Int(scale))

We want to avoid mixing currency (integer) and extended (floating
point) if possible. Anyway, you will see that IBO is already doing
something similar.

This does not negate the fact that an overflow can occur if the type
was NUMERIC(18,2) - if database does not restrict the input via a
check on the domain/field to only 14 digits of whole number.

Geoff Worboys
Telesis Computing