oracle SQL 加载程序日期格式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21425825/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 02:12:32  来源:igfitidea点击:

SQL Loader date format

sqldatabaseoracledate

提问by rkyyk

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.

嗨,我正在尝试将文件中的数据加载到 Oracle 中的表中,但我收到错误 ORA-01843:插入日期时无效月份。

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

文件中的日期为 27-01-2014

The format in my table is set to DATE.

我的表中的格式设置为 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

干杯

回答by arunb2w

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

Oracle 可能需要 27 作为一个月,它会抛出这样的错误

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")