Excel匯入Oracle資料庫

來源:互聯網
上載者:User

標籤:excel匯入   oracle   

1.錄入excel測試表格,test.xls。
2.另存新檔.csv格式
3.建立sql*loader控制檔案test.ctl,內容如下:
Load data
Infile ‘c:\test.csv‘
insert Into table test Fields terminated by ‘,‘(column1,column2,column3,column4,column5)

需要將資料檔案拷貝到對應位置

4.到資料庫中建立對應的測試表test

create table test (
column1 Varchar2(10),
column2 Varchar2(10),
column3 Varchar2(10),
column4 Varchar2(10),
column5 Varchar2(10)
)

5.執行匯入命令
Sqlldr userid = system/123456 control=‘C:\test.ctl‘

匯入成功!

附:
Sqlldr的函數關鍵字說明:
Userid--oracle使用者名稱 userid = username/password
Control --控制檔案名稱 control = ‘e:\insert.ctl’
Log–-記錄檔名稱 log = ‘e:\insert.log’
Bad--損壞檔案名稱
Data--data file name
Discard--discard file name
Discardmax --number of discards to allow(預設全部)
Skip--匯入時跳過的記錄行數(預設0)
Load--匯入時匯入的記錄行數(預設全部)
Errors--允許錯誤的記錄行數(預設50)

ctl檔案內容說明:
Load data
Infile ‘e:\test.csv’--資料來源檔案名稱
Append|insert|replace--append在表後追加,insert插入空表,replace替代原有內容
Into table test--要匯入的資料庫表名稱
[when id = id_memo]--過濾條件
Fields terminated by X’09’ --欄位分隔符號
(id,name,telphone)--欄位名稱列表


Excel匯入Oracle資料庫

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.