Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Y2K QUESTION automatic conversion
Yes, thanks Tommy for more clearly stating my question.
I understand how NLS_DATE works, and that I could change it.
However, what I'm really trying to do is avoid changing a lot of
Pro*C code I am maintaining. Throughout this code, there are these
inserts using CHAR strings of 'DD-MON-YY' format. (Bad code practice,
I know, but I came along after the fact!) I am hoping that I don't
have to change these inserts, as I am trying to make the application
Y2K compliant with the minimum amount of code changes possible. I
am lucky in that my application doesn't have any dates before 1950
or after 2049, so I am using the "windowing" strategy (i.e., the
strategy represented by the RR format) to avoid bumping up the
length of all those character variables and input fields!
Tommy Wareing wrote:
>
> What Doug means is
>
> If one converts a string to a date using the YY format mask, then the
> database defaults the century. As we know, this currently defaults to
> 19. But where does this come from? Is it built into the database
> somewhere, or is it taken from the current system date?
>
> This will make a difference come the year 2000:
> '5-MAY-98' currently (today being the 6th May, 1998) means 05/05/1998.
> But what will it mean on the 1st January, 2000? Will it still mean
> 05/05/1998, or will it suddenly mean 05/05/2098?
>
> Unfortunately, I don't know the answer
>
> On 6 May 1998 11:46:19 GMT, "Barry Jones" <jonesb_at_logica.com> wrote:
>
> |>No, the reason this works currently is your NLS_DATE format has set to 2
> |>digit years.
> |>You have the choice of either changing the NLS_DATE format or performing a
> |>to_date with 4 digit year picture.
> |
> |>Doug Henderson <dough_at_dsp35001.ca.boeing.com> wrote in article
> |><354FB25D.17E4_at_dsp35001.ca.boeing.com>...
> |>> A Y2K-related question about automatic conversion of data types:
> |>>
> |>> I understand that Oracle automatically converts a CHAR string to DATE
> |>> if the CHAR string is in the "default Oracle" (i.e., DD-MON-YY)
> |>> format. So, an insert like the following will work in SQL*PLUS:
> |>>
> |>> INSERT INTO some_table (st_date) /* st_date is a DATE column */
> |>> VALUES '05-MAY-98';
> |>>
> |>> The year for the date inserted by the above statement will end up
> |>> as 1998 in the database.
> |>>
> |>> My question is, will such automatic conversion work correctly after
> |>> 1/1/2000? In other words, will the century portion of the year for
> |>> such an insert automatically be the 21st century after 1/1/2000?
>
> --
> Tommy Wareing
> MIS Group
> Learning Resources
> Oxford Brookes University
> 01865 483389
Received on Wed May 06 1998 - 11:45:30 CDT
![]() |
![]() |