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: Newbie - Date Format Problem

Re: Newbie - Date Format Problem

From: Thomas Meyer <i03a_at_zfn.uni-bremen.de>
Date: 26 May 1999 14:33:55 GMT
Message-ID: <7ih0oj$bek$3@kohl.informatik.uni-bremen.de>


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

Original text of this message

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