Reputation:
I'm trying to upload data through sql loader but I'm not able to upload the data in oracle database I'm getting below error.
data test.csv
1,a,b,c,d,20150728
2,a1,b1,c1,d1,20150727
3,a2,b2,c2,d2,20150726
4,a3,b3,c3,d3,20150725
5,a4,b4,c4,d4,20150724
1st Method
load data
into table table_abc
fields terminated by "," optionally enclosed by '"'
(t1,t2,t3,t4,t5,t6 date 'YYYYMMDD')
Error
Record 1: Rejected - Error on table T_LLY_08135_20150302_001, column t6.
ORA-01858: a non-numeric character was found where a numeric was expected
2nd Method
load data
into table table_abc
fields terminated by "," optionally enclosed by '"'
(t1,t2,t3,t4,t5,t6 date TO_DATE(t6,"MMDDYYYY"))
Error
SQL*Loader-350: Syntax error at line 4.
Expecting "," or ")", found "TO_DATE".
t1,t2,t3,t4,t5, date TO_DATE(t6,"MMDDY
table structure
sqlplus> desc table_abc
TABLE varchar2
Name Null? Type
--------- -------- ----------------------------
t1 NOT NULL NUMBER(38)
t2 varchar2(38)
t3 varchar2(38)
t4 varchar2(38)
t5 VARCHAR2(400)
t6 date
Upvotes: 1
Views: 928
Reputation: 2115
try your first example but use double quotes
load data
into table table_abc
fields terminated by "," optionally enclosed by '"'
(t1,t2,t3,t4,t5,t6 date "YYYYMMDD")
Upvotes: 1