oracle 檔案資料匯入

2021-08-07 18:43:05 字數 866 閱讀 5261

其中 load data infile '/***x/test123/4444.txt'  為需要匯入的檔案路徑

into table t_d_win_prize  為需要匯入的的表名稱

1) insert     --為預設方式,在資料裝載開始時要求表為空

3) replace  --刪除舊記錄(用 delete from table 語句),替換成新裝載的記錄

4) truncate --刪除舊記錄(用 truncate table 語句),替換成新裝載的記錄

fields terminated by ','  ---為以『,』為文

件的分割符進行資料分割 

trailing nullcols   ---為沒有賦值的列可以為空

(msisdn,username,id "periodlanage_seq.nextval")  ---和檔案中需要新增加的列一一對應

其實id "periodlanage_seq.nextval" 表示id 這列使用自增序列。 沒有宣告的列為空

命令執行:

sqlldruserid=username/password@***  control=m-periodlanage.ctl log=m-periodlanage.log errors=1000

為了防止插入到資料出現亂碼,需要設定編碼格式:

export lang=zh_cn.gb2312   ---lang是針對linux系統的語言、地區、字符集的設定,對linux下的應用程式有效,如date;

export nls_lang=american_america.zhs16gbk   ---nls_lang是針對oracle

語言、地區、字符集的設定,對oracle中的工具有效。

Mysql檔案資料匯入

mysql匯入資料load data infile用法 基本語法 load data low priority local infile file name txt replace ignore into table tbl name fields terminated by t optionall...

dbf檔案資料匯入資料庫

在設計介面用fileupload伺服器控制項 後台 public int exportdbf sourcetype dbf sourcedb serverpath exclusive no null no collate machine backgroundfetch no deleted no c...

sql檔案資料匯入資料庫

1.建立createsql.sql檔案,內容 drop table if exists t user create table t user user id int 11 not null auto increment,user name char 30 not null,user password...