Dear Informixers,
I inherited a legacy application that stores most data in one large flat
table. There is a unique record ID that serves as primary key for this
table.
Now there is a requirement for storage and processing of additional
information for each new record, most of it timestamps, but also some
other
data. These new requirements are dynamic in nature, meaning that it
is very likely that management will come up with additional ideas in
the near future ;-)
In other applications, I have very good experience with storing
information
in attribute/value pairs, so when a new requirement arises, I can just
define an additional attribute and be all set. For the "value" column,
I always used the "char" datatype. This works fine even when numeric
values and computations are necessary, IDS does the implicit conversions
for me.
Now is the first time I want to use this approach for datetime and/or
interval data. Since we are on IDS 10 which sup****ts casting of data
types,
could I just write the data in the necessary format (e.g. YYYY-MM-DD
HH:MM:SS)
into a "char" or "varchar" column and use casts to datetime/interval types
when doing datetime/interval arithmetic either in SQL or ESQL/C? Or are
there any good reasons not to do this, and use explicitly declared
datetime
and interval columns instead?
Regards, Richard


|