以下の内容はhttps://htn20190109.hatenablog.com/entry/2024/11/10/081153より取得しました。


{SQL Loader}SQL*Loaderを実行

 


https://docs.oracle.com/cd/F19136_01/sutil/oracle-sql-loader-concepts.html#GUID-817B408D-57AA-49F0-A2AA-1DEE8C1A2D8F

 

              固定レコード形式
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;

 

 




以上の内容はhttps://htn20190109.hatenablog.com/entry/2024/11/10/081153より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14