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

From: Palooka <nobody_at_nowhere.com>
Date: Tue, 10 Feb 2009 23:16:12 +0000
Message-ID: <ZUnkl.30236$715.1554_at_newsfe28.ams2>



Noons wrote:
> 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.
Or write the application properly, as Sybrand recommends. Not arguing with you Noons, since you are of course perfectly correct. One just gets sick of this shoddy crappy application code.

Palooka Received on Tue Feb 10 2009 - 17:16:12 CST

Original text of this message