Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Possible Y2K trap in using DECODE?
On Thu, 14 Jan 1999 11:36:33 +0200, "Grinberg L."
<leon_at_grant.kharkov.ua> wrote:
>Jurij Modic wrote:
>I agree that it is unexpected but documented result.
>
>But you can try
>
> INSERT INTO destination_table (date_column)
> SELECT DECODE('31.12.2000', '00000000', to_date(NULL), -- !!!
> TO_DATE('31.12.2000','DD.MM.YYYY'))
> FROM DUAL;
>
>and you will get true datest.
>
>Good luck,
>
>Leon Grinberg leon_at_grant.kharkov.ua
Leon,
I could swear this was the firs thing I tried when I discovered this DECODE behaviour and I could swear the results convinced me that this was not a sollution - I've also written that in my reply to Erwin Dondorp <erwindon_at_wxs.nl>. However, when I tried this just now I can see that this realy is a cure - I obviously made a mistake in my first probe.
So I stand corrected - the "TO_DATE(NULL)" realy solves this DECODE problem.
Thanks,
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)