sqlldr簡單匯入自增序列的資料

2021-09-30 14:58:32 字數 1088 閱讀 5181

建表

create table wbh_temp7

(id number,

terminal_id varchar2(50)

)建序列

create sequence seq_a

minvalue 1

maxvalue 99999999

start with 1

increment by 1

nocache;

如果1.txt內容為以下

號碼11111111

22222222

33333333

44444444

控制檔案1.ctl

load data

infile "1.txt" --匯入資料檔案名稱

into table wbh_temp7 --目標資料庫表名

fields terminated by "," --指定資料列的分隔符

trailing nullcols -- 表的字段沒有對應的值時允許為空

(terminal_id,

id "seq_a.nextval" --id列匯入seq_a的自增序列

)匯入命令

sqlldr user/password control=1.ctl skip=1 load=200000 errors=100 rows=1000 bindsize=33554432

user/password //資料庫的使用者名稱密碼

control //sqlldr控制檔案位置

skip=1 //表示跳過第一行,從第二行開始匯入

load=200000 //表示並不匯入所有的資料,只匯入跳過skip引數後的200000條資料

rows=1000 //表示一次載入的行數,預設值為64,此處設定為1000

errors=100 //表示出錯100次後,停止載入

bindsize=33554432 //表示每次提交記錄緩衝區的大小,預設256k

匯入資料後資料庫表中的內容

id terminal_id

1 11111111

2 22222222

3 33333333

4 44444444

ORACLE 自增序列

1 在plsql下先建立乙個專用的使用者 create the user create user user1 identified by user1 default tablespace users temporary tablespace temp profile default grant re...

MySQL 自增序列

5.7.23 select version 非主鍵形式的自增欄位 create table test3 id int auto increment not null,str varchar 2 key id 自增預設從1開始 truncat後,自增序列重新開始 設定自增開始值 同時 建立自增序列字段...

mysql 實現id自增序列 mysql自增id列

如果希望在每次插入新記錄時,自動地建立主鍵欄位的值。可以在表中建立乙個 auto increment 字段。mysql 使用 auto increment 關鍵字來執行 auto increment 任務。預設地auto increment 的開始值是 1,每條新記錄遞增 1。主鍵又稱主關鍵字,主關...