Sql Loader控制文件带" "

时间:2016-05-11 14:35:35

标签: oracle csv sql-loader

我目前正在使用带有控制文件的sqlloader将.csv文件加载到表中但是在表的末尾我得到双引号,如何阻止它们加载?我只想将数据加载到表中?这是.ctl文件:

LOAD DATA
APPEND
INTO TABLE omh_esn_model_details_06nov
append
fields terminated by ","  trailing NULLCOLS
(
ESN_NO char(200),
MAKER constant "ZGH",
MODEL_NO constant "M81",
OFFER constant "OFFER"
)

这是.csv文件内容的值是逐行的:

ESN No 
A10000428A5789 
A1000046685985 
A1000484526948

最后我在插入

后在表格中得到这样的结果
"A10000428A5789" ZGH  M81  OFFER

2 个答案:

答案 0 :(得分:0)

还有一些东西还没有加起来。你如何摆脱" ESN No"数据文件中的文字?在此期间尝试更改此行:

fields terminated by ","  trailing NULLCOLS

到此:

fields terminated by ","
OPTIONALLY ENCLOSED BY '"'
trailing NULLCOLS

答案 1 :(得分:0)

我得到了答案,我加载的文件有^ M个字符,所以这就是问题。谢谢大家