ISAM and SE
Posted in 1999
Topics: General Discussion
Can anyone tell me how Informix SE stores a date/time in a table so that ISAM can read it? I'm trying to take a set of ISAM files created using Informix C-ISAM and created an Informix SE schema based on it. One of the fields (expiration_date) is defined as time_t - but I really don't know how that would be defined using SE as a date/time variable. Any help would be appreciated. Joe
JLK62 wrote: > Can anyone tell me how Informix SE stores a date/time in a table > so that ISAM can read it? I'm trying to take a set of ISAM files > created using Informix C-ISAM and created an Informix SE schema > based on it. One of the fields (expiration_date) is defined as > time_t - but I really don't know how that would > be defined using SE as a date/time variable. All SE data is stored in C-ISAM files, but not all C-ISAM files are appropriately structured for SE. Generally speaking, the best way to create a C-ISAM file for access from SE is to use SE to create the file. Otherwise, you'll have to write a program to analyze what SE does with the indexes -- I don't remember the details, but it does something odd with index 0 to allow it to use ROWIDs. The time_t value would be a count of seconds since 1970-01-01 00:00:00 GMT (UTC arrived a few years later). The best way to treat it is as an INTEGER column. If you need the date/time when something will expire, use: SELECT DATETIME(1970-01-01 00:00:00) + time_t_column UNITS SECOND Worry about your time zones unless you are in a GMT timezone all year. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>