问题描述
我正在Oracle中创建外部表,如下所示:
create or REPLACE directory PATH_ENTITY as 'C:\001Billing\loadFiles';
create table DWH_TABLE (
SECUENCIA VARCHAR2(150),CAMPO2 VARCHAR2(150)
)
ORGANIZATION EXTERNAL
( type oracle_loader
default directory PATH_ENTITY
access parameters
( fields terminated by ''|''
missing field values are null
)
location ('textfile.txt')
);
文本文件内容
20200820090816024009|20200820090816023905
当我阅读表格时,出现以下错误
select * from DWH_TABLE;
Error ORA-29913 ODCIEXTTABLEOPEN
Oracle版本
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
解决方法
正如错误消息所述-单引号字符串存在问题
替换无效的带引号的字符串
fields terminated by ''|''
使用
fields terminated by '|'
,
我怀疑您创建的目录上的当前用户缺少必要的授予,
您能否根据需要提供username
和read
的赠款(将write
替换为您的实际用户,然后尝试尝试,
grant read on directory path_entity to username;
grant write on directory path_entity to username;