Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Loader date format

Hi i am trying to load data from a file into a table in Oracle but i am recieving a error ORA-01843: not a valid month when inserting a date.

The date in the file is held as 27-01-2014

The format in my table is set to DATE.

This is the control file.

load data
infile 'file1.csv'
append
into table my_table
fields terminated by ',' TRAILING NULLCOLS
(Case_reference, Attempt_Number, Dialled_Number, Date_Called)

Any one know where im going wrong?

Cheers

like image 542
rkyyk Avatar asked Jan 29 '14 08:01

rkyyk


1 Answers

Oracle may take 27 as a month and it throws such error

Try to give the format in the control file itself

load data
infile 'file1.csv'
append
into table my_table
fields terminated by ',' TRAILING NULLCOLS
(Business_function, 
Case_reference, 
Sub_sequence, 
Dialler_Master_Stream ,
Dialler_Call_Stream,    
Dialler_Super_Stream, 
Attempt_Number, 
Dialled_Number, 
Date_Called DATE "DD-MM-YYYY")
like image 189
arunb2w Avatar answered Sep 22 '22 16:09

arunb2w