Fixed Record Format 固定长度 INFILE datafile_name "fix n" 固定11个字节 [oracle@pcqtestxi01 ~]$ cat example.ctl example.dat ----example.ctl ---- load data infile 'example.dat' "fix 11" into table example fields terminated by ',' optionally enclosed by '"' (col01,col02) ----example.dat ---- 001, cd, 0002,fghi, 00003,lmn, 1, "pqrs", 0005,uxwx, [oracle@pcqtestxi01 ~]$ sqlldr monitor/password control=example.ctl SQL*Loader: Release 11.2.0.4.0 - Production on Tue Jun 12 11:45:16 2018 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Commit point reached - logical record count 5 查询加载成功的数据 SQL> select * from dbmonitor.example; COL01 COL02 ----- -------------------------------------------------- 001 cd 0002 fghi 00003 lmn 1 pqrs 0005 uxwx Variable Record Format 变量记录格式 INFILE datafile_name "var n" [oracle@pcqtestxi01 ~]$ cat example01.ctl example01.dat ----example01.ctl------ load data infile 'example01.dat' "var 3" into table example fields terminated by ',' optionally enclosed by '"' (col01 char(5), col02 char(7)) ----example01.dat------ 009hello,cd,010world,im, 012my,name is, [oracle@pcqtestxi01 ~]$ sqlldr monitor/password control=example01.ctl SQL*Loader: Release 11.2.0.4.0 - Production on Tue Jun 12 11:41:03 2018 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Commit point reached - logical record count 3 [oracle@pcqtestxi01 ~]$ dba SQL*Plus: Release 11.2.0.4.0 Production on Tue Jun 12 11:41:06 2018 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select * from dbmonitor.example; COL01 COL02 ----- -------------------------------------------------- hello cd world im my name is Stream Record Format 流记录格式 INFILE datafile_name ["str terminator_string"] terminator_string被指定为'char_string'或X'hex_string',其中: 'char_string'是用单引号或双引号括起来的字符串 X'hex_string'是一个十六进制格式的字节串 当terminator_string包含特殊(不可打印)字符时,应该将其指定X'hex_string。可是经过使用反斜杠,能够将一些不可打印的字符指定为(‘char_string’) \ n表示换行 \ t表示一个水平标签 \ f表示换页 \ v表示一个垂直选项卡 \ r表示回车
Result
|
Exit Code
|
All rows loaded successfully
|
EX_SUCC
|
All or some rows rejected
|
EX_WARN
|
All or some rows discarded
|
EX_WARN
|
Discontinued load
|
EX_WARN
|
Command-line or syntax errors
|
EX_FAIL
|
Oracle errors nonrecoverable for SQL*Loader
|
EX_FAIL
|
Operating system errors (such as file open/close and malloc)
|
EX_FAIL
|
Table 9-2 Datatype Conversions for Datetime and Interval Datatypes
|
|
SQL*Loader Datatype
|
Oracle Database Datatype (Conversion Support)
|
N
|
N (Yes), C (Yes), D (No), T (No), TS (No), YM (No), DS (No)
|
C
|
N (Yes), C (Yes), D (Yes), T (Yes), TS (Yes), YM (Yes), DS (Yes)
|
D
|
N (No), C (Yes), D (Yes), T (No), TS (Yes), YM (No), DS (No)
|
T
|
N (No), C (Yes), D (No), T (Yes), TS (Yes), YM (No), DS (No)
|
TS
|
N (No), C (Yes), D (Yes), T (Yes), TS (Yes), YM (No), DS (No)
|
YM
|
N (No), C (Yes), D (No), T (No), TS (No), YM (Yes), DS (No)
|
DS
|
N (No), C (Yes), D (No), T (No), TS (No), YM (No), DS (Yes)
|