外部表的badfile、discardfile、LOGFILE??
drop table ex_test1;
CREATE TABLE ex_test1 (
"col1" varchar2(20),
"col2" varchar2(20),
"col3" varchar2(20),
"col4" varchar2(20)) ORGANIZATION EXTERNAL (TYPE ORACLE_LOADER DEFAULT DIRECTORY test_dir ACCESS PARAMETERS (
RECORDS DELIMITED BY '\n' CHARACTERSET ZHS16GBK STRING SIZES ARE IN BYTES READSIZE 10000000
nobadfile nodiscardfile noLOGFILE FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY'"' LDRTRIM
REJECT ROWS WITH ALL NULL FIELDS
( "col1" CHAR(255)
TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
,"col2" CHAR(255)
TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
,"col3" CHAR(255)
TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
,"col4" CHAR(255)
TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
)
) LOCATION ('test1.txt')) REJECT LIMIT UNLIMITED PARALLEL;
select * from ex_test1;
以上代码执行正常,
问题: 一旦在“noLOGFILE”的位置替换为“LOGFILE 'ext_test_1.log'”的话,执行 “select * from ex_test1”就报错?
为啥?
另外一旦定义badfile\discardfile的话,执行 “select * from ex_test1”也报错,为什么???
------解决方案--------------------
我这边没有问题。。
报错的把错误的信息贴出来啊,
我这边到是没有报错
SQL code
CREATE TABLE ex_test1 (
"col1" varchar2(20),
"col2" varchar2(20),
"col3" varchar2(20),
"col4" varchar2(20))
ORGANIZATION EXTERNAL
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY EXT_DIR
ACCESS PARAMETERS
(
RECORDS DELIMITED BY '\n'
CHARACTERSET ZHS16GBK
STRING SIZES ARE IN BYTES READSIZE 10000000
nobadfile
nodiscardfile
LOGFILE '1.log'
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY'"' LDRTRIM REJECT ROWS WITH ALL NULL FIELDS
( "col1" CHAR(255) TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
,"col2" CHAR(255) TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
,"col3" CHAR(255) TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
,"col4" CHAR(255) TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
)
)
LOCATION ('test1.txt')
)
REJECT LIMIT UNLIMITED PARALLEL;