LarrySteele
Programmer
I've encountered an issue I've never seen before and I couldn't find a solution through Google.
I'm using SQLLDR to bring data from some text files, nothing particularly special. The files are CSV with double-quotes where needed. The inbound data appears good.
The problem is that dates prior to 1950, Oracle is adding a century. So for a date before 1950 such as "2/6/1948" in the inbound file, Oracle stores "2/6/2048" in the table. For dates 1950 or after such as "4/24/1973" Oracle correctly stores "4/24/1973". This is consistent through all date columns and all rows.
Here's the header portion of my SQLLDR control file:
[tt]LOAD DATA
INFILE '...'
REPLACE
INTO TABLE "FOO"."BAR"
FIELDS TERMINATED BY ',' optionally enclosed by '"'
TRAILING NULLCOLS
([/tt]
Here's one of the lines where I'm bringing in a date field:
[tt]birthdate "decodebirthdate,'#EMPTY',null,to_datebirthdate,'MM/DD/YYYY'))",
[/tt]
Any idea what would cause this and how to correct it?
Thanks in advance,
Larry
I'm using SQLLDR to bring data from some text files, nothing particularly special. The files are CSV with double-quotes where needed. The inbound data appears good.
The problem is that dates prior to 1950, Oracle is adding a century. So for a date before 1950 such as "2/6/1948" in the inbound file, Oracle stores "2/6/2048" in the table. For dates 1950 or after such as "4/24/1973" Oracle correctly stores "4/24/1973". This is consistent through all date columns and all rows.
Here's the header portion of my SQLLDR control file:
[tt]LOAD DATA
INFILE '...'
REPLACE
INTO TABLE "FOO"."BAR"
FIELDS TERMINATED BY ',' optionally enclosed by '"'
TRAILING NULLCOLS
([/tt]
Here's one of the lines where I'm bringing in a date field:
[tt]birthdate "decodebirthdate,'#EMPTY',null,to_datebirthdate,'MM/DD/YYYY'))",
[/tt]
Any idea what would cause this and how to correct it?
Thanks in advance,
Larry