I'm in the process of converting a system from MySQL to Oracle. Currently hitting a problem of loading the data from csv into the import table. I did find a work-around, but it's not ideal. I'm able to turn all columns into varchar and load. Then do another load from this table to my actual table. But seems this should be possible without the added step. I've never had such a frustrating time trying to get data into a database before. I appreciate any assistance you can offer.
This is failing with ORA-01816, date can't be specified twice
Sample of the csv file
agg_id~agg_name~createdby~createdate~modifiedby~modifieddate
5~mae_west~mars~"21-OCT-04 01.03.23.966000 PM"~tars~"16-SEP-16 03.11.22.256000 PM"
18~37arrows~azdven~"27-AUG-10 12.10.12.214000 PM"~tars~"16-SEP-16 04.16.01.171000 PM"
This is the SQL Loader ctl file
OPTIONS ( SKIP=1)
LOAD DATA
CHARACTERSET UTF8
INTO TABLE AGGREGATOR
FIELDS TERMINATED BY '~' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(
FILE_ROW_ID RECNUM,
EXTRACT_DATE SYSDATE,
AGG_ID,
AGG_NAME,
CREATED_BY,
CREATED_DATE DATE 'DD-Month-YY HH.MI.SS AM',
MODIFIED_BY,
MODIFIED_DATE DATE 'DD-Month-YY HH.MI.SS AM')
The date fields need to be specific as following
- EXTRACT_DATE '09/19/2016' 'MM/DD/YYYY'
- CREATED_DATE '10/21/2004 01:03:24 PM' 'MM/DD/YYYY HH:MI:SS AM'
- MODIFIED_DATE '9/16/2016 03:11:22 PM' 'MM/DD/YYYY HH:MI:SS AM'
NLS_DATE is set as 'MM-RR-YYYY'
CREATE TABLE AGGREGATOR
(
FILE_ROW_ID NUMBER(12) NOT NULL,
EXTRACT_DATE DATE NOT NULL,
AGG_ID NUMBER(12) NOT NULL,
AGG_NAME VARCHAR2(200 BYTE) NOT NULL,
CREATED_BY VARCHAR2(35 BYTE) NOT NULL,
CREATED_DATE DATE NOT NULL,
MODIFIED_BY VARCHAR2(35 BYTE) NOT NULL,
MODIFIED_DATE DATE NOT NULL
)