Informix creating decimal(42) data type
Posted in 1994
Hello, Informix gurus.
I think that I may have found a bug in SE 5.00.UD1.
Environment:
System V Release 4.2
ISQL Release 4.0
SE Release 5.00.UD1
Background:
To create a view that will hold the standard deviation.
The first step was to:
create view stdev1 (spropcd, number, y1, y2)as
select
spropcd [1,25],
count(*) number,
sum(spropval*spropval) y1,
sum(spropval)*sum(spropval) y2
from statview
group by 1;
create view stdev2 (desc, number, y1, y3)as
select spropcd,
y1,
y2/n
from stdev1;
NOTES: spropcd is char(100)
spropval is smallfloat
Actual values involved are as follows:
number = 3
y1 = 776
y2 = 2304
Info on tables stdev1 and stdev2 indicates the following:
spropcd is char(25)
desc is char(25)
number is an integer
y1 is decimal(21)
y2 is decimal(32)
>>>>>> y3 is decimal(42) <<<<<<
(I assume that INFORMIX is creating y1 and y2 as decimals
because it knows that two small floats multiplied together
have the potential for being rather large. However,
why y1 is decimal(21) and y2 is decimal(32) and why
they aren't the same is beyond me.)
Also, my documentation says that the DECIMAL is a floating
point number with a total of m (<=32) significant digits.
Furthermore, when I try to create a column of a decimal
type with a length of 42 I get a message saying 'The
length must be a positive integer not exceeding 32.'
Problem:
The create view statements above work correctly. However, when I
select stdev2.y3 I get a segmentation error and a resulting core dump.
Does this qualify as a bug? If so, is there any way to work around
it? Personally, any time I see the segmentation error core dump
scenario my first reaction is to reach for the fly swatter. :-)
Thanks for your help and advice in advance.
==========================================================================
== George Teachman ==
== Soil Scientist ==
== United States Department of Agriculture - Soil Conservation Service ==
== Fort Collins, Colorado ==
== 303-282-1960 ==
== ==
== george@talon.ftc.scs.ag.gov ==
== ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ==
== Welcome to earth, third rock from the sun. Cause and effect. ==
== There are only three laws of nature, and one exception. ==
== 1) F=ma; 2) E=m(c squared); 3) You can't push a rope ==
== From these three laws all others can be derived. ==
== Except those explained by CHAOS THEORY. ==
==========================================================================