Re: Informix 4GL Bug Impacting Datetime Fields
Posted in 1996
James Fischer wrote:
>
> I came across an interesting problem that may be
> of concern to other Informix 4GL developers.
>
> Assume that you define a datetime value with a
> granularity of fractional seconds, for example:
>
> datetime(year to fraction)
>
> The only tool available within 4GL to get
> the time of day is the 4GL "current" function,
> but don't expect to get a time value from the
> 4GL "current" function with granularity more
> accurate than whole seconds.
This bug is not exclusive to Informix-4gl. If you try the following
sequence of sql commands in dbaccess...
create temp table abc (abc datetime year to fraction);
insert into abc values (current);
select * from abc;
...you will get values in whole seconds. I assume this will occur
using any client, as "current" in this case is an SQL function handled
by the database engine.
> Since it is easy to accomplish two different
> operations on a record in less than a second,
> any logs or homebrew audit trails that attempt
> to use fractional seconds may present some
> confusion over the exact order of changes made.
I suppose you would have to add an integer counter (serial field?) to
determine the exact order of changes made - more wasted space.
Thanks for the pointer. I hadn't noticed this bug before.
--
----------------------------------------------------------------------
John H. Frantz Power-4gl: Extending Informix-4gl
frantz@centrum.is http://www.strengur.is/~frantz/pow4gl.html