SQLLDR的一个简单例子

1、导入表的结构:

CREATE TABLE MARA1
(MATNR VARCHAR2(18) NOT NULL,
 MATKL VARCHAR2(3)  DEFAULT ‘ ‘,
 GROES VARCHAR2(40) DEFAULT ‘ ‘,
 ERSDA DATE);

2、参数文件内容:

USERID=TEST/TEST@FIRSTDB
CONTROL=MARA.CTL
ROWS=10

3、控制文件内容:

LOAD DATA
INFILE ‘MARA.TXT’
APPEND INTO TABLE MARA
FIELDS TERMINATED BY X’09′ OPTIONALLY ENCLOSED BY ‘"’
(MATNR,MATKL,GROES,ERSDA DATE "YYYY-MM-DD")

4、命令行输入内容:

SQLLDR PARFILE=MARA.PAR

Comments are closed.