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: to_char put into a date?

Re: to_char put into a date?

From: Mark D Powell <mark.powell_at_eds.com>
Date: 28 Sep 2001 06:21:19 -0700
Message-ID: <178d2795.0109280521.212461c8@posting.google.com>


Robert William Vesterman <bob.work_at_vesterman.com> wrote in message news:<h247rtkiof2iuu5qrvterlqck2t8m6mn84_at_4ax.com>...
> On Thu, 20 Sep 2001 07:23:25 GMT, Matthias Gresz
> <nospam_at_newsranger.com> wrote:
>
> >You should use time_processed = sysdate instead of the to_char-conversion.
>
> I understand that. I was surprised when I saw that the person had
> attempted to stick a to_char (sysdate, 'blah') into a date field, and
> I was further surprised when I saw that Oracle ALLOWED that to be done
> without returning some sort of error.
>
> >At
> >the moment you seem to be lucky, that the box you ran the population from has
> >NLS_DATE set in a way that it understands 'MM/DD/YYYY HH24:MI:SS'. May be it's
> >setting is 'DD/MM/YYYY HH24:MI:SS' so you will run into problems with some
> >dates.
>
> I don't believe this is the case - like I said, I can no longer treat
> it as a date field, I must treat it as a char field, even though the
> column itself is a date, not a char or varchar or whatever. That is,
> in order to treat the stuff that I get out of the date field as a
> date, I now have to do a to_date on it. Since I specify the format in
> the to_date, I don't think there's an issue like you imply where DD
> and MM could potentially get confused.
>
> >Don't know what the programmer thought about converting date to char to store it
> >in a date field.
>
> I know, but unfortunately it's there.
>
> Bob Vesterman.

Have you considered and then tried to update the table column values to being valid dates: update table set date_col = to_date(date_col) and seeing what happens.

Received on Fri Sep 28 2001 - 08:21:19 CDT

Original text of this message

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