Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie - Date Format Problem
Alex Daman <alex_daman_at_yayoo.com> wrote:
>When inserting into a date field, I keep getting an - Invalid month no
>error.
>Is there an environment variable that ORACLE uses that will allow me to
>format my dates.
>e.g. :
>insert into table_s (field_1, date_field) values ('string_data',
>'05-27-99');
>But if I format the date data as '05-May-99' it works.
You need to tell Oracle what format the data is in. Normally you would
do an
INSERT INTO table_s (field_1, date_field) VALUES ('string',
to_date('05-27-99','mm-dd-yy'))
The to_date transforms the string with the specified format to the internal Oracle date format.
I hope I got that right... :)
Thomas
--
Thomas Meyer, Bremen, Germany
mailto:i03a@zfn.uni-bremen.de -- http://www1.uni-bremen.de/~i03a/
Received on Wed May 26 1999 - 09:33:55 CDT