Re: Help Loading YYYYMMDD Dates

From: Starr Larry G <a00048_at_mailhub.wpl.com>
Date: 1995/05/23
Message-ID: <3psqkt$vag_at_wpl.wpl.com>#1/1


James Richard wrote:
>>In article <3pdgjc$msu_at_newsbf02.news.aol.com> roywagner_at_aol.com (Roy Wagner) writes:
>>
>> I'm am trying to load dates from a file that has them in the format
>> YYYYmMdD, where a lower case letter represents a blank if the month or
>> year is < 10. I do not what to HAVE TO reformat these dates in the flat
>> files that I need to transfer to ORACLE 7.1. However, this examples shows
>> what happens when I try and load dates with blanks. ORACLE seems to skip
>> the blank on the month's first column and attempt to read if from the
>> first column of the day columns. What is causing this and how can I load
>> dates in this format without changing their format in the flat file.
>>
>> Thanks to anyone that can help.
>>
>> - Roy Wagner (a new ORACLE user) -

You did not mention what OS you are using so here is a pure Oracle Solution:

select to_date(replace('1995 1 1', ' ', '0'), 'YYYYMMDD') FROM DUAL; The replace function will replace all spaces with "0" (zero) before "to_date" processes it.

Enjoy~

-- 
===============================================================================
=   Larry G. Starr |  a00048_at_mailhub.wpl.com  | Phone (608) 252-3471          =
=             I shot an arrow into the air ... IT GOT STUCK!!!                =
===============================================================================
Received on Tue May 23 1995 - 00:00:00 CEST

Original text of this message