Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Informix > Table design qu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 14134 of 15119
Post > Topic >>

Table design question: (var)char vs. datetime/interval

by Richard Spitz <Richard.Spitz@[EMAIL PROTECTED] > Jun 2, 2008 at 05:48 PM

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
 




 5 Posts in Topic:
Table design question: (var)char vs. datetime/interval
Richard Spitz <Richard  2008-06-02 17:48:39 
Re: Table design question: (var)char vs. datetime/interval
TBP <thebigpotato@[EMA  2008-06-02 16:54:31 
Re: Table design question: (var)char vs. datetime/interval
Richard Spitz <Richard  2008-06-03 17:58:26 
Re: Table design question: (var)char vs. datetime/interval
Jonathan Leffler <jona  2008-06-03 00:24:42 
Re: Table design question: (var)char vs. datetime/interval
Richard Spitz <Richard  2008-06-03 18:10:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 0:02:50 CST 2008.