Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: to_char put into a date?
On 20 Sep 2001 00:20:13 -0700, crsoza_at_hotmail.com (C. R. Soza) wrote:
>The problem is your time_processed field is not a date type column.
>You can only do date arithmetic between two date fields. By doing what
>you did, you converted the char column to date so it worked. Its no
>fluke and it is the right fix in this instance. (unless of course you
>change the column from char to date).
No, that's false. The column IS a date. But for some reason, somebody attempted to stick a "to_char ( sysdate, 'blah' )" into it, EVEN THOUGH THE COLUMN IS A DATE, and it seemingly worked. However, when you read that entry, it can no longer be treated as a date; you now have to do a to_date on it, EVEN THOUGH THE COLUMN IS A DATE.
My question is, can I rely upon this behaviour to work, i.e. does sticking a to_char into a date field and then getting it out of the date field using a to_date necessarily work, or have we just been lucky thus far?
Thanks,
Bob Vesterman. Received on Thu Sep 27 2001 - 15:46:52 CDT