Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Error - ORA-01861: literal does not match format string"
On 2005-04-29, Abhishek <abhitriv_at_netscape.net> wrote:
> In my application working on oracle 10g database and Red Hat Linux
> Advanced Server 2.1 on HP Itanium pcs.
>
> When i use in my query statements like
>
> update table1 set colmn_dt = to_date(sysdate,'DD/MON/YYYY');
>
> it is giving me the following error.
>
> ORA-01861: literal does not match format string"
>
>
> The resaon for this is i can understand that i m trying to use a date
> type column in a to_date function.
>
> What i cannot undertand is that why did this has not given me the
> error uptil now(the application has been running for one year approx)
> and now also it is giving me the error for some cases only, otherwise
> this query runs fine.
to_date(...) converts something to a date type. sysdate is _already_ a date-type. So, no need to convert it to a date-type. You probably want to_char.
hth
Rene
-- Rene Nyffenegger http://www.adp-gmbh.ch/Received on Fri Apr 29 2005 - 16:34:47 CDT