Re: SE has array datatype?
Posted in 1995
In article <hotchD1w7rr.Lww@netcom.com>,
hotch@netcom.com (Hotchkiss and Wiley) wrote:
> ... However, I can't figure
> out from reading the documentation if I can specify a
> datatype as an array since I want to repeat a decimal
> datatype across 40 columns.
> Do I have to say:
> $create table coupons
> {
> coupon1 decimal(5,3),
> coupon2 decimal(5,3),
> ...
> coupon40 decimal(5,3)
> }
> or is there a way to declare ...{ coupons[40] decimal(5,3) }
There is no way to define an array in a table.
The prefered way to implement what you're trying to achieve (from an ease
of programming and clarity of design - but maybe not performance -
point of view) would be:
create table coupons (coupon_num integer,
coupon_value decimal(5,3))
Also means you don't swallow wads of disk space for the occasions when
you only use 1 coupon, and makes life MUCH easier when you need to
handle that 41st coupon :-)
Your code will end up looking a lot cleaner too.
Regards,
Kerry S
--------------------------------------,-------------------------------------
Kerry Sainsbury, kerry@kcbbs.gen.nz | THE INFORMIX FAQ
Quanta Systems, Auckland, New Zealand | kcbbs.gen.nz:/informix/*
| mathcs.emory.edu:/pub/informix/faq/*
+64 9 377-4473 (work) 276-5546 (home) | quasar.ucar.edu:/?