![[ Informix Logo ]](/_borders/inflogo1.gif) |
Архив интересных статей по Informix |
Re: Using numeric(p) vs integer
In article <7etib0$8j2$1@nnrp1.dejanews.com>, <jvnet@excite.com> wrote:
>I'm an Informix newbie. Ant help would be appreciated. I'm running 7.22 on
>NT 4.0. I have a field in a table which holds a value up to 10 digits. This
>is defined as "numeric(10)". Is there any advantage to utilizing this data
>type versus using a data type of "integer" instead?
From the Informix Guide to SQL: Reference, Version 7.2, page 3-16:
--
The INTEGER data type stores whole numbers that range from -2,147,483,647
to 2,147,483,647. The maximum negative number, -2,147,483,648, is a
reserved value and cannot be used. The INTEGER data type is stored as a
signed binary integer and is typically used to store counts, quantities, and so
on.
--
INTEGER can be interpreted as 32-bit unsigned data, with one caveat:
there's a hole at 2,147,483,648. That number is not representable with
an INTEGER type, since this value is reserved to represent a NULL.
NUMERIC(10) gives you the range -9,999,999,999 to 9,999,999,999 without
any such holes.
Jim
--
W. Jim Jordan, Nortel Networks, Stop 313 Qualicum,
PO Box 3511 Stn C, Ottawa, ON K1Y 4H7 Canada wjjordan@nortelnetworks.com
Opinions expressed are not necessarily those of Nortel Networks.
Inbound spam filtering is in place; don't send what I won't see.
| [ Home ] |
Сайт создан при поддержке Украинского
представительства Informix Software Inc. |
Hosted by ANTEC |