Re: Y2K question.
Posted in 1999
Suhas Tembe wrote:
> For the past few days, we have been doing some Y2K testing on our
> systems. I am facing a peculiar problem when I do the following
> using ISQL.
>
> Scenario 1 :
>
> create temp table tab1 ( start_date date) with no log;
> insert into tab1 values ("03/05/00");> select year(start_date) from tab1;
>
> The output is 2000; which is correct since we have set the DBCENTURY
> variable to 'C' (Closest).
>
> Scenario 2 :
>
> create temp table tab1 ( start_date date) with no log;
> load from "test.unl" { test.unl looks like: "03/05/00"| }
> insert into tab1;> select year(start_date) from tab1;
>
> The output is 1900 & not 2000 as above.
>
> I am not quite sure if this is because of the older versions
> of I4GL & ISQL.
>
> We have Informix OnLine 7.23 UC6 with I4GL & ISQL ver 6.05 UC2.
Tricky, and the short answer is "Yes; the I4GL and ISQL are not
DBCENTURY aware and that accounts for the problem."
The longer answer has to explain why there's a different result.
The reason is that in Scenario 1, the engine (which is DBCENTURY
aware, though it is debatably Y2K compliant - check the Informix
web site for whether that version is fully Y2K compliant) is doing
the conversion from string to date, so DBCENTURY rules apply.
In Scenario 2, the LOAD command reads the data from the file and
does the conversion to date in the ISQL program. This means that
the data is not converted using DBCENTURY rules. Interesting, but
correct.
Moral: if you want full Y2K compliance, use Y2K compliant software.
Version 6.0x is not officially Y2K compliant, and you've found a
clever (and devious) way to demonstrate the problems.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
#include <disclaimer.h>