oracle外部表数据分隔难题
现有文本文件需要用外部表方式连接,不过此文件中的数据没有|,\t等分隔,数据不足字段长度的用空格补,就这么直接连在一起,请问外部表能按字段定长进行处理吗,如果能下面这段代码应如何改?
sqlstr:='CREATE TABLE '||temp_User||'.'||TABLE_NAME||'
(
AGENT_NO NUMBER(10) ,
COMMISION_DINNER VARCHAR2(10 BYTE)
)
Organization external
( type oracle_loader
default directory '||DIRECTORY_NAME||'
access parameters
(records delimited by newline
nologfile
nobadfile
nodiscardfile
fields terminated by ''|''
missing field values are null
reject rows with all null fields
(
AGENT_NO char(100),
COMMISION_DINNER char(100)
)
)
location ('a.txt')
)
reject limit unlimited';
execute immediate sqlstr;