Re: ORA-01861: literal does not match format string

From: Noons <wizofoz2k_at_yahoo.com.au>
Date: Wed, 11 Feb 2009 01:27:37 +1100
Message-ID: <gms2jv$dsa$1_at_news.motzarella.org>



shweta.kaparwan_at_googlemail.com wrote,on my timestamp of 11/02/2009 1:05 AM:

>
> SQL> select * from T1 where last_update=to_date('2008-02-10
> 05:59:17','yyyy-mm-dd hh24:mi:ss');

> NAME TYPE VALUE
> ------------------------------------ -----------
> ------------------------------
> nls_calendar string
> nls_comp string
> nls_currency string
> nls_date_format string dd-mon-rrrr
> nls_date_language string
> nls_dual_currency string
> nls_iso_currency string
> nls_language string american
> nls_length_semantics string byte
> nls_nchar_conv_excp string FALSE
> nls_numeric_characters string ,.
> nls_sort string
> nls_territory string america
> nls_time_format string
> nls_time_tz_format string
> nls_timestamp_format string
> nls_timestamp_tz_format string
>
> SQL>
>
>
> We cannt chnage the java code immediately to use to_date.
> so how to avoid such error:?

Set your nls_date_format parameter to match what you are using in java:

alter system set nls_date_format=
'yyyy-mm-dd hh24:mi:ss' scope=both;

Be aware that this changes the default date format for ALL sessions and users in future.
If you only want it for the java session(s), then you must find a way to add a alter session for the same parameter to set the format for only those. Received on Tue Feb 10 2009 - 08:27:37 CST

Original text of this message