Re: Help Loading YYYYMMDD Dates

From: Blv n Drms <blvndrms_at_aol.com>
Date: 1995/05/19
Message-ID: <3pjgih$t6r_at_newsbf02.news.aol.com>#1/1


Roy,
On your sql*loader line for this field use this decode to get the right date into the database:
for field called MYDATE:

to_date(substr(mydate1,4)||
decode
(length(ltrim(substr(mydate,5,2)),1,'0'|ltrim(substr(mydate,5,2)),substr(m
ydate,5,2))||
decode
(length(ltrim(substr(mydate,7,2)),1,'0'|ltrim(substr(mydate,7,2)),substr(m
ydate,7,2))
,'YYYYMMDD') the first piece gets the year
the second piece decodes the month..if leading blank, substitutes leading zero
the third piece decodes the day..if leading blank, substitutes leading zero

Dates have to be the worst thing to work with in sql*loader..hope this helps you.

Jack Richter
Eagles International, Inc
Senior Consultant-Oracle
Jack Richter Received on Fri May 19 1995 - 00:00:00 CEST

Original text of this message