数据文件:d:new.csv
控制文件:d:test.ctl
数据表:t_content_flow
控制文件内容:
load data
infile 'D:\new.csv'
append into table t_content_flow
fields terminated by ';'
trailing nullcols
(year,month,day,hour,time,icp,content_type,operator_code,operator_type,throughput,session_time,country_name,country_iso,country_code,area_name,area_code,city_name,city_cod
注:先要在数据库建表,表结构和控制文件的表结构一致!
执行:sqlldr userid=username/password@127.0.0.1/dataname control=d:test.ctl