将下列文件可存为一个test.bat
sqlldr Username/Password@serviceName control=ctl_customer.ctl
构造ctl_customer.ctl文件
Load data
infile 'customer.txt'
append
into table tblCustomer
fields terminated by ' '
trailing nullcols
(
SERIES_ID ,
Cust_id,
category_flag,
INITIALS,
sex_code,
Title,
cust_mp,
cust_ph1,
cust_fax,
CONCAT_ADDR "substr(trim(:concat_addr),1,64)",
cust_email,
cust_postcode,
mhi,
Original_date Date "YYYY-MM-DD HH24:Mi:SS",
dlr_salecode,
veh_model,
veh_series_model,
Refresh_date Date "YYYY-MM-DD HH24:Mi:SS",
status_flag,
Agent_id
)
将下列文本存为customer.txt
39960 Eh39960 P 郭斌 M 0108621501 01088570023110 [email protected] 100081 2004-2-17 9:05:02 A02176 B 2004-3-24 15:00 1 00
39961 Eh39961 P 单旭 M 01307775938 077158513151314 南宁市民族大道73号广西电视台 [email protected] 530022 1 2004-3-20 1:39:45 A04613 B 2004-3-24 15:00 1 00在命令行执行ld.bat
sqlldr Username/Password@serviceName control=ctl_customer.ctl
构造ctl_customer.ctl文件
Load data
infile 'customer.txt'
append
into table tblCustomer
fields terminated by ' '
trailing nullcols
(
SERIES_ID ,
Cust_id,
category_flag,
INITIALS,
sex_code,
Title,
cust_mp,
cust_ph1,
cust_fax,
CONCAT_ADDR "substr(trim(:concat_addr),1,64)",
cust_email,
cust_postcode,
mhi,
Original_date Date "YYYY-MM-DD HH24:Mi:SS",
dlr_salecode,
veh_model,
veh_series_model,
Refresh_date Date "YYYY-MM-DD HH24:Mi:SS",
status_flag,
Agent_id
)
将下列文本存为customer.txt
39960 Eh39960 P 郭斌 M 0108621501 01088570023110 [email protected] 100081 2004-2-17 9:05:02 A02176 B 2004-3-24 15:00 1 00
39961 Eh39961 P 单旭 M 01307775938 077158513151314 南宁市民族大道73号广西电视台 [email protected] 530022 1 2004-3-20 1:39:45 A04613 B 2004-3-24 15:00 1 00在命令行执行ld.bat
但是,我是在程序中调用的,
可以写个能直接在sql plus中执行的sql语句吗?