學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 工具軟件 > 辦公軟件學(xué)習(xí) > Excel教程 > Excel基礎(chǔ) > 如何將excel導(dǎo)入oracle數(shù)據(jù)庫的教程

如何將excel導(dǎo)入oracle數(shù)據(jù)庫的教程

時(shí)間: 業(yè)華773 分享

如何將excel導(dǎo)入oracle數(shù)據(jù)庫的教程

  在Excel中錄入好數(shù)據(jù)以后就需要導(dǎo)入到oracle數(shù)據(jù)庫,或許有些朋友不知道該如何做。下面是學(xué)習(xí)啦小編帶來的關(guān)于如何將excel導(dǎo)入oracle數(shù)據(jù)庫的教程,歡迎閱讀!

  如何將excel導(dǎo)入oracle數(shù)據(jù)庫的教程:

  導(dǎo)入oracle數(shù)據(jù)庫步驟1:oracle數(shù)據(jù)庫有一個(gè)student表,現(xiàn)有一個(gè)excel表:student.xlsx,需導(dǎo)入oracle數(shù)據(jù)庫student表中。

  導(dǎo)入oracle數(shù)據(jù)庫步驟2:student表的擁有者是system,system密碼為test

  導(dǎo)入oracle數(shù)據(jù)庫步驟3:打開需導(dǎo)入的excel表格,單擊office按鈕,選擇另存為--其他格式

  導(dǎo)入oracle數(shù)據(jù)庫步驟4:選擇保存路徑(置于D:\),保存類型CSV(逗號(hào)分隔)(*.csv),設(shè)置文件名為student.csv,單擊保存

  導(dǎo)入oracle數(shù)據(jù)庫步驟5:新建input.ctl文件(置于D:\),內(nèi)容為:

  load data

  infile 'd:\student.csv'

  append into table student fields terminated by ','

  trailing nullcols(id,name,sex,age)

  說明:infile后面參數(shù)為欲導(dǎo)入的excel表(已轉(zhuǎn)換成csv格式)路徑及名稱;append在表后追加;table后面跟oracle數(shù)據(jù)庫中的表名稱; terminated by ','表示字段分隔符;(id,name,sex,age)表示字段名稱列表

  導(dǎo)入oracle數(shù)據(jù)庫步驟6:同時(shí)按Windows徽標(biāo)鍵和R鍵,打開運(yùn)行,輸入cmd,打開命令提示符,輸入命令:

  sqlldr userid=system/test@netservicename control=d:\input.ctl

  說明:system/test,為oracle數(shù)據(jù)庫表student的所有者及其密碼;

  @ netservicename為網(wǎng)絡(luò)服務(wù)名;

  control是input.ctl文件名稱及路徑

  導(dǎo)入oracle數(shù)據(jù)庫步驟7:進(jìn)入oracle數(shù)據(jù)庫,查詢student表,excel已導(dǎo)入成功

656303