Subject Re: [ib-support] Re: Numeric and decimal
Author Ivan Prenosil
From: "Sandor Szollosi" <ssani@...>
> But one more question:
> > (e.g. you can store 1234567.89 into NUMERIC(6,2))
>
> 1234567.89 is NUMERIC(6,2)?

This number has precision 9 and scale 2.
According to SQL standard, you may be able to store it in DECIMAL(6,2) data type
(depends on implementation), but you should not be able to store it in NUMERIC(6,2).

FB/IB will internally use the datatype with at least the required precision
(INTEGER in this case, thus allowing storing numbers with precision up to 9).

In FB/IB you can store 1234567.89 into NUMERIC(6,2) field,
while SQL standard says that you should get error.


>
> The datadefguide writes(IB6Betadocs/page61) about numeric:
>
> "Example: NUMERIC(10,3) holds numbers accurately in following format:
> ppppppp.sss"
>
> Is it right?

Yes. (except, as said earlier, you can in fact store numbers with higher precision,
18 in this case, because the underlying datatype in Dialect-3 will be INT64)


Ivan Prenosil
[ I am looking for a job: InterBase - Firebird - Delphi - C - fulltext db - and more ... ]
Ivan.Prenosil@...
http://www.volny.cz/iprenosil/interbase