Subject | Re: [ib-support] Re: Numeric and decimal |
---|---|
Author | Ivan Prenosil |
Post date | 2003-05-18T23:04:20Z |
From: "Sandor Szollosi" <ssani@...>
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.
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
> But one more question:This number has precision 9 and scale 2.
> > (e.g. you can store 1234567.89 into NUMERIC(6,2))
>
> 1234567.89 is NUMERIC(6,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.
>Yes. (except, as said earlier, you can in fact store numbers with higher precision,
> The datadefguide writes(IB6Betadocs/page61) about numeric:
>
> "Example: NUMERIC(10,3) holds numbers accurately in following format:
> ppppppp.sss"
>
> Is it right?
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