Subject Re: [ib-support] Numeric Datatype question
Author Kaputnik
Numerics hold any number which is possible in the underlying physical
datatype.
The possible datatypes are smallint, integer and int64 or floating point (I
think not for IB6 anymore)

If you define a numeric(5,0) it has to store at least numbers ranging
from -99.999 until 99.999 and therefore, a smallint doesn't suit anymore
(32k max)
Interbase then stores this numeric physically as integer-value in the
database, giving 32bits of precision to it. Numerics therefore can store
more than the definition lets assume.

Given a numeric(11,0), interbase will have to take an int64 physically,
allowing you to store values up to 18 digits of precision...

Hope, this helps
CU, Kaputnik
(Nick Josipovic)

nick@...
kap@...
-----------------------------------------------------------------------
superior Client/Server programming:
www.IBObjects.com
a nice Tool for Interbase:
www.InterbaseWorkbench.com
----- Original Message -----
From: Andrew McBeath
To: ib-support@yahoogroups.com
Sent: Wednesday, February 14, 2001 1:29 PM
Subject: Re: [ib-support] Numeric Datatype question


Having played around with this a bit more, I declared both a numeric(5,0)
and a decimal(5,0). Both fields accept numbers up to 9 digits long
(inclusive). This seems to go against documentation:

"Numeric(5,0) declares that a column of this type always holds exactly 5
digits..." (page 64. DataDef.pdf)

Could someone please shed some light on this for me?


Regards,

Andrew

> Reading the doc (page 64 of the DataDef.pdf), it says that numeric always
> stores as many digits as the maximum size of the field.
>
> My question is:
>
> Will Numeric(5,0) store 1 as 00001 or just 1? Or will an insert of 1 into
> that field fail as it doesnt contain enough digits?
>
>
> Cheers,
>
> Andrew
>
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>



To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com