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 -> Date formats with opt time portion? (eg. NLS_DATE_FORMAT)

Date formats with opt time portion? (eg. NLS_DATE_FORMAT)

From: Randall J. Parr <RParr_at_TemporalArts.COM>
Date: Tue, 03 Aug 1999 09:00:36 -0500
Message-ID: <37A6F604.F508B8B4@TemporalArts.COM>


I am trying to insert records with dates which may or may not include the time portion of the date. I am reading these records from a text file using Java and performing the inserts with JDBC.

For exmple A) '07/02/1990' or B) '07/02/1999 00:00:00'

With NLS_DATE_FORMAT set to 'MM/DD/RRRR' date B gives an error (more or less) "ran out of date format before finished".

With NLS_DATE_FORMAT set to 'MM/DD/RRRR HH24:MI:SS' date A gives and error (more or less) "incomplete date"

Is there a way to set a date format (preferably a default format) such that the time portion of the date is optional?

I am trying to avoid solutions which include wrapping the date to be inserted in JDBC escapes and/or TO_DATE( mydate, 'myformat') because I only have column name and column data in the text file (that is, the text file doesn't contain any information about the column types).

Thanks
R.Parr
Temporal Arts Received on Tue Aug 03 1999 - 09:00:36 CDT

Original text of this message

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