Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Year 2000 problem

Re: Year 2000 problem

From: Gilles Pétrin <gpetrin_at_ix.netcom.com>
Date: 1997/05/01
Message-ID: <33694765.1101@ix.netcom.com>#1/1

Mark Brooks wrote:
>
> The Oracle7 database does not have a year 2000 problem. Oracle stores
> dates with the 4 digit year. The issue with applications ( Oracle
> Financials or any other Oracle based app) is did the programmer handle
> the date formating on inserts/selects correctly.
>
> Mark...
>

There is at least one "Year 2000" bug with Oracle7. It is still present in 7.2 and I think it may be found in 7.3 too. If your default date format is set with two-digit year and you issue the following command:

select decode(my_date_string,'00000000',NULL,

           to_date(my_date_string,'YYYYMMDD')) from dual;

(I am not sure if it is that way or with the decode inside the to_date  but in any case try both)

and my_date_string contains '20000229' you get an "Invalid date" error.

The reason? According to Oracle this is not a bug because even though you specify a four-digit year in the format, the DECODE function always goes back to your default date format, then adds the default century in front and comes up with '19000229' in this case. By the way, just in case, February 29th 2000 is valid but February 29th 1900 is not.

If your setup is with a default of two-digit years then try it again with '20000228': the result will be February 28th 1900!

And remember, this is not a bug... Last I heard Oracle was not going to issue a patch for this... So it must be a feature.

Gilles Received on Thu May 01 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US