![[ Informix Logo ]](/_borders/inflogo1.gif) |
Архив интересных статей по Informix |
Re: Using numeric(p) vs integer
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? Also Informix
Well, integer holds 9+ digits decimal(10) (or numeric(10)) holds 10
digits floating point. (BTW if you need a 10 digit integer you can use
decimal(10,0)). Decimal(10) uses 6 bytes of storage compared to 4 for
integer. Calculations are slightly, though noticeably, faster for
integer but formatting to string is slightly faster for decimal(10).
> documentation lists storage space for decimal data types with both a
> precision and a scale. That is the documentation does not distinguish
> between floating point and fixed point for storage allocation. How would this
> differ e.g. numeric (10), nemeric (10,3) ? Thanks JV
Storage required of decimal(10) and decimal(10,3) or decimal(0) is the
same though decimal types declared with an explicit scale are slightly
more efficient to calculate with, in my experience, than decimals
declared floating.
Art S. Kagel
| [ Home ] |
Сайт создан при поддержке Украинского
представительства Informix Software Inc. |
Hosted by ANTEC |