Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Date Insert Problem

Re: Date Insert Problem

From: <fitzjarrell_at_cox.net>
Date: 6 Feb 2006 14:52:54 -0800
Message-ID: <1139266374.359975.97250@g14g2000cwa.googlegroups.com>

camou wrote:
> I am string to insert dates in this format :2005-08-19
>
> I tried to do : insert into foo (foodate) values('2005-08-19');
>
> foo date is an Oracle date type field.
>
> I get [ORA-01861: literal does not match format string]\

Hmmm, I wonder why ... oh, yes, in most cases the nls_date_format is
set to 'DD-MON-RR' ... and, gee, that doesn't match what you've tried
to submit as a date ...

>
> I can only get a text filed with dates in this format. How can i insert
> this.
>

Reading the documentation (something you should try) reveals the following function to convert date strings into actual dates:

insert into foo (foodate) values(to_date('2005-08-19', 'YYYY-MM-DD'));

> Thanks!

David Fitzjarrell Received on Mon Feb 06 2006 - 16:52:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US