今天写东西用到了外部表
create table ext_country(
id number(5) ,
name nvarchar2(32)
)
ORGANIZATION EXTERNAL
(
TYPE ORACLE_LOADER
DEFAULT DIRECTORY ext_alumni
ACCESS PARAMETERS
(
RECORDS DELIMITED BY NEWLINE
FIELDS TERMINATED BY ','
)
LOCATION('ext_country.dat')
);
数据格式
1,中国,
2,美国,
3,加拿大,
4,英国,
5,澳大利亚,
6,法国,
7,德国,
8,新西兰,
9,新加坡,
查询的时候一直报错查看log
Field Definitions for table EXT_COUNTRY
Record format DELIMITED BY NEWLINE
Data in file has same endianness as the platform
Rows with all null fields are accepted
Fields in Data Source:
ID CHAR (255)
Terminated by ","
Trim whitespace same as SQL Loader
NAME CHAR (255)
Terminated by ","
Trim whitespace same as SQL Loader
KUP-04021: field formatting error for field ID
KUP-04023: field start is after end of record
KUP-04101: record 31 rejected in file D:\ora_external\ext_country.dat
原来是txt文件最后几行居然是空格行.....