一、具体数据如下要导入到aa表中phonenum,status,create_time,fee字段中,由于id字段是主键所以该字段不能为空值因此也要导入相应的值,本例中id 字段直接导入序列值
13858000000,2,2009-5-15 14:55:04,835
13868000000,1,2009-5-22 10:39:04,84
13958000000,1,2009-6-16 17:31:08,59
13456640000,1,2008-7-28 21:45:53,37
13505710000,1,2009-5-20 11:37:45,365
13505720000,1,2009-5-20 11:38:37,65
13505800000,1,2009-5-20 11:41:08,12
13505810000,1,2009-5-20 11:41:42,13
13505840000,1,2009-5-20 11:42:19,246
13506550000,1,2008-10-23 0:59:18,108
13506810000,1,2009-5-20 11:47:43,400
13516720000,1,2009-8-19 18:30:50,98
13566030000,1,2008-8-9 7:05:03,113
13566130000,1,2009-10-16 10:04:00,14
13566220000,1,2008-11-14 14:13:25,14
13566230000,1,2008-11-15 7:43:32,204
13566320000,1,2008-8-9 8:37:21,285
13566350000,1,2008-8-9 9:07:10,28
二、aa表结构如下:
Name Null? Type
--------------------- -------- ----------------------------
ID NOT NULL NUMBER
PHONENUM VARCHAR2(20)
CF NUMBER
CREATE_TIME DATE
MSG VARCHAR2(150)
ICPNO VARCHAR2(20)
STATUS NUMBER
QUIT_TIME DATE
BUSI_TYPE VARCHAR2(20)
FEE NUMBER
FLAG NUMBER(5)
SUBTYPE NUMBER
UNSUBTYPE NUMBER
MEMO VARCHAR2(100)
AREA VARCHAR2(10)
三、创建导入数据的控制文件:
vi zzy.ctl
load data
infile '/data/12.txt'
append into table aa
fields terminated by ','
trailing nullcols
(id sequence(87,1),phonenum,status,create_time date "yyyy-mm-dd hh24:mi:ss",fee terminated by whitespace)
四、具体导入的命令:
sqlldr username/paasswd control=zzy.ctl direct=true
[@more@]
--转自