1.將要導入的Excel數據文件轉為csv文件(不需要標題)
2.新建ctl文件 內容如下:
load data
infile 'e:\sql\fsfp.csv' //csv文件位置
into table "TMP_INVOICE_TEST" //表名(測試時,表名小寫會報錯)
fields terminated by ','
(NAME,TAX,ENO,CODE,TOTAL,TAXATION,URL,TIMES) //csv文件數據對應的數據表中的字段,一一對應
3.cmd輸入命令:
sqlldr userid=ydfp/ydfp@192.168.1.1:1001/YDYW control=e:\sql\imp.ctl log=e:\sql\222.log
sqlldr userid=用戶名/密碼@地址 control=ctl文件位置 log=日志文件位置(可有可無)
4.selec * from TMP_INVOICE_TEST //數據導入成功