Excel資料匯入Oracle

2021-08-24 18:25:47 字數 1241 閱讀 8860

1、開啟microsoft excel 2000

2、檔案(f)→新建(n)→工作簿→

3、輸入資料,存檔為test.xls

4、檔案(f)→另存為(a)→

儲存型別為:製表符分隔,起名為text.txt,儲存到c:\

5、連入sql*plus

以system/manager使用者登入,

sql> conn system/manager

建立表結構

sql> create table test (

id       number,        --序號

username    varchar2(10),     --使用者名稱

password    varchar2(10),     --密碼

sj       varchar2(20)      --建立日期

); 6、建立sql*loader輸入資料所需要的檔案,均儲存到c:\,

控制檔案:input.ctl,內容如下:

load data           --1、控制檔案標識

infile 'test.txt'       --2、要輸入的資料檔案名為test.txt

fields terminated by x'09'  --4、字段終止於x'09',是乙個製表符(tab)

(id,username,password,sj)   -----定義列對應順序

a、insert,為預設方式,在資料裝載開始時要求表為空

c、replace,刪除舊記錄,替換成新裝載的記錄

d、truncate,同上

7、在dos視窗下使用sql*loader命令實現資料的輸入

c:\>sqlldr userid=system/manager control=input.ctl

預設日誌檔名為:input.log

預設壞記錄檔案為:input.bad

附:(1) input.ctl :

load data    

infile 'book1.txt'

fields terminated by x'09'

(cms_ch_number,cms_ch_parentid,cms_ch_name,cms_ch_code)

(2) dos視窗下sql*loader命令:

sqlldr

dev_user/pass@tnsnames_string control=input.ctl

Oracle匯入excel資料方法彙總

摘要 在程式編制過程和資料彙總交換過程中,經常會碰到需要將其他人員在office辦公環境下編制的檔案資料內容匯入oracle中的情況。目前程式開發者經常使用的方法有如下幾種 1,使用oracle提供的匯入工具sql loader 2,使用plsql developer工具 3使用其他資料轉移工具做中...

Excel資料匯入到oracle

excel資料匯入到oracle 第一步 將要匯入的excel檔案開啟,選擇 另存為 在檔案型別那裡選擇 文字.txt 後確定儲存 第二步 開啟記事本,編寫下列的內容 注釋 1 控制檔案標識 2 剛才由excel檔案轉化過來的檔案的路徑 3 向oracle的資料表t network agent ba...

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,colum...