2015-04-04 33 views
0

這裏是什麼在我的.CTL文件:使用sql loader加載文件時出現無效數字?

load data infile './certified.txt' 
append into table certified 
fields terminated by "," (employeeID, airplaneID) 

錯誤(短路重複無效的行數):

SQL*Loader: Release 10.2.0.4.0 - Production on Sat Apr 4 16:41:04 2015 

Copyright (c) 1982, 2007, Oracle. All rights reserved. 


Control File: loader.ctl 
Data File:  ./certified.txt 
    Bad File:  certified.bad 
    Discard File: none specified 

(Allow all discards) 

Number to load: ALL 
Number to skip: 0 
Errors allowed: 50 
Bind array:  64 rows, maximum of 256000 bytes 
Continuation: none specified 
Path used:  Conventional 

Table CERTIFIED, loaded from every logical record. 
Insert option in effect for this table: APPEND 

    Column Name     Position Len Term Encl Datatype 
------------------------------ ---------- ----- ---- ---- --------------------- 
EMPLOYEEID       FIRST  * ,  CHARACTER    
AIRPLANEID       NEXT  * ,  CHARACTER    

Record 1: Rejected - Error on table CERTIFIED, column AIRPLANEID. 
ORA-01722: invalid number 

Record 2: Rejected - Error on table CERTIFIED, column AIRPLANEID. 
ORA-01722: invalid number 
MAXIMUM ERROR COUNT EXCEEDED - Above statistics reflect partial run. 

Table CERTIFIED: 
    0 Rows successfully loaded. 
    51 Rows not loaded due to data errors. 
    0 Rows not loaded because all WHEN clauses were failed. 
    0 Rows not loaded because all fields were null. 


Space allocated for bind array:     33024 bytes(64 rows) 
Read buffer bytes: 1048576 

Total logical records skipped:   0 
Total logical records read:   64 
Total logical records rejected:  51 
Total logical records discarded:  0 

Run began on Sat Apr 04 16:41:04 2015 
Run ended on Sat Apr 04 16:41:04 2015 

Elapsed time was:  00:00:00.28 
CPU time was:   00:00:00.03 

我用來創建該表的行:

create table certified (employeeID int, airplaneID int); 

這裏是數據文件中的內容(同樣省略了一些數據,行之間沒有空格,只是放在那裏,因爲我有這個網站的格式化問題):

567354612,1 
567354612,2 
567354612,10 
567354612,11 
567354612,12 
+0

難道是你在這個問題中遺漏的那些白線引起了問題嗎? – GolezTrol 2015-04-04 21:52:35

+0

我只是這樣做,因爲我不能找出堆棧溢出格式。文件中沒有白線。 – Dean 2015-04-04 23:46:54

回答

0

我的問題是,文本文件出現問題。下面的命令修復了它們,一切都很完美!

perl -p -i -e 's/\r\n$/\n/g' aircraft.txt certified.txt flights.txt employees.txt 
相關問題