固定レコード形式
vi example.dat
396, ty,
4922,beth,
68773,ben,
1, "dave",
5455,mike,
vi example.ctl
load data
infile 'example.dat' "fix 11"
into table example truncate
fields terminated by ',' optionally enclosed by '"'
(col1, col2)
create table test.example(col1 number, col2 varchar2(10));
sqlldr test/test@orcl control=example.ctl data=example.dat log=example.log
select * from test.example;
可変レコード形式
vi example2.dat
010hello,cd,
010world,im,
012my,name is,
vi example2.ctl
load data
infile 'example2.dat' "var 3"
into table example2 truncate
fields terminated by ',' optionally enclosed by '"'
(col1 char(5),
col2 char(7))
create table test.example2(col1 varchar2(5),col2 varchar2(7));
sqlldr test/test@orcl control=example2.ctl data=example2.dat log=example2.log
select * from test.example2;
ストリームレコード形式
vi example3.dat
hello,world,
james,bond,
vi example3.ctl
load data
infile 'example3.dat' "str '\n'"
into table example3 truncate
fields terminated by ',' optionally enclosed by '"'
(col1 char(5),
col2 char(7))
create table test.example3 (col1 varchar2(5),col2 varchar2(7));
sqlldr test/test@orcl control=example3.ctl data=example3.dat log=example3.log
select * from test.example3;