[oracle@mydb ~]$vi /home/oracle/gyj_test.dat
A Joe 433101196303180048
B Tom 432325197810254019
(3)控制文件
[oracle@mydb ~]$ vi /home/oracle/gyj_test.ctl
load data
infile '/home/oracle/gyj_test.dat'
discardfile gyj_test.dat.dsc
into table gyj_test1
when tab='A'
(tab filler position(1:1),
xm position(3:5),
sfzh position(*+1:24)
)
into table gyj_test2
when tab='B'
(tab filler position(1:1),
xm position(3:5),
sfzh position(*+1:24)
)
(4)加载数据
oracle@mydb ~]$ sqlldr userid=gyj/gyj control=/home/oracle/gyj_test.ctl
SQL*Loader: Release 11.2.0.3.0 - Production on Tue Sep 10 13:08:38 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 2
(5)验证两表的数据
gyj@OCM> select * from gyj_test1;
XM SFZH
-------------------- --------------------
Joe 433101196303180048
gyj@OCM> select * from gyj_test2;
XM SFZH
-------------------- --------------------
Tom 432325197810254019
[oracle@mydb ~]$ vi /home/oracle/gyj_test3.ctl
load data
infile '/home/oracle/gyj_test1.dat'
infile '/home/oracle/gyj_test2.dat'
into table gyj_test3
fields terminated by '|'
(xm,sfzh)
(4)加载数据
[oracle@mydb ~]$ sqlldr userid=gyj/gyj control=/home/oracle/gyj_test3.ctl
SQL*Loader: Release 11.2.0.3.0 - Production on Tue Sep 10 13:16:13 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 1
Commit point reached - logical record count 2
(5)验证这张表的数据
gyj@OCM> select * from gyj_test3;
XM SFZH
-------------------- --------------------
Joe 433101196303180048
Tom 432325197810254019