外部表查询时出现ORA-29913和ORA-29400错误

2023-05-16,,

create table t_ext_tab(id char(1),name char(6))
organization external(
type oracle_loader
default directory scott_dir
access parameters(
records delimited by newline
fields terminiated by '#')
location ('ext.tab')
);

select * from t_ext_tab;
*
第 1 行出现错误:
ORA-29913: 执行 ODCIEXTTABLEOPEN 调出时出错
ORA-29400: 数据插件错误KUP-00554: error encountered while parsing access parameters
KUP-01005: syntax error: found "identifier": expecting one of: "column, enclosed, exit, (, ltrim, lrtrim, ldrtrim, missing, notrim, optionally, rtrim,
 reject, terminated"
KUP-01008: the bad identifier was: terminiated
KUP-01007: at line 2 column 8
ORA-06512: 在 "SYS.ORACLE_LOADER", line 19

错误原因——从错误提示信息中可以看到是解析access parameters时出错了。仔细检查发现fields terminiated by '#'中的关键字terminiated写错了。正确的应该是"terminated"。

外部表查询时的ORA-29913和ORA-29400错误,通常是由于其中关键字写错或定义的文件不存在。创建外部表时oracle不会验证其正确性。


外部表查询时出现ORA-29913和ORA-29400错误的相关教程结束。

《外部表查询时出现ORA-29913和ORA-29400错误.doc》

下载本文的Word格式文档,以方便收藏与打印。