我想根据数据文件创建外部表,但是我收到了错误。我使用空格来分隔我的记录,但这不起作用。是的我创建了目录并提供了读写权限,而不是创建外部表。但是,当我选择它时,我收到了一个错误:
ORA-29913:执行ODCIEXTTABLEOPEN标注时出错 ORA-29400:数据盒式磁带错误
我的外部表是:
create table nflteams_ext (
ACR varchar2(4),
NAME varchar2(20))
organization external
(
type oracle_loader
default directory ext_tab_data
access parameters (
records delimited by newline CHARACTERSET US7ASCII
fields terminated by whitespace
missing field values are null
(ACR varchar2(4),
NAME varchar2(20))
)
LOCATION ('NFL_Teams.dat')
)
REJECT LIMIT UNLIMITED NOPARALLEL;
data file:
NO New Orleans Saints
PIT Pittsburgh Steelers
IND Indianapolis Colts
答案 0 :(得分:0)
问题解决了。我在外部tablecreation的下半部分使用了char而不是varchar2,我也用' / n'。
CREATE TABLE nflteams_ext
(acr VARCHAR2( 4),
name VARCHAR2(20))
ORGANIZATION EXTERNAL
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY ext_tab_data
ACCESS PARAMETERS
(RECORDS DELIMITED BY NEWLINE CHARACTERSET US7ASCII
FIELDS TERMINATED BY WHITESPACE
MISSING FIELD VALUES ARE NULL
(acr CHAR( 4),
name CHAR(20) TERMINATED BY '/n'))
LOCATION ('NFL_Teams.dat'))
REJECT LIMIT UNLIMITED
NOPARALLEL /
SELECT * FROM nflteams_ext
2 /
ACR NAME
没有新奥尔良圣徒 PIT Pittsburgh Steelers IND印第安纳波利斯小马队
选择了3行。