Here's a crazy one: the same external table definition works fine in one database, but fails in another. Not schema - database. Two databases, both on the same OS, different servers. In addition, it's failing on the 2nd date field, though both are defined the same. The NLS settings are the same on both servers, thought I thought the date mask should override that anyway. Here's the definition:
-- access parameters
-- http://docs.oracle.com/cd/E11882_01/server.112/e16536/et_params.htm
CREATE TABLE ext_tab (
FIELD1 VARCHAR2(30),
FIELD2_DATE DATE,
FIELD3 VARCHAR2(4),
FIELD4 VARCHAR2(6),
FIELD5_DATE DATE
)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY DIR_DATADIR
ACCESS PARAMETERS
( RECORDS DELIMITED BY NEWLINE
NOBADFILE
NODISCARDFILE
LOGFILE 'LOGFILE_LOG'
FIELDS
TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"' and '"'
LRTRIM
MISSING FIELD VALUES ARE NULL
REJECT ROWS WITH ALL NULL FIELDS
(
FIELD1 CHAR(30),
FIELD2_DATE CHAR(8) date_format DATE mask 'YYYYMMDD',
FIELD3 CHAR(4),
FIELD4 CHAR(6),
FIELD5_DATE CHAR(8) date_format DATE mask 'YYYYMMDD'
)
)
LOCATION ('Sample_Input_csv.csv')
)
REJECT LIMIT UNLIMITED
NOPARALLEL;
Here's sample data:
TOTEA01217611,20121122,TOTE,847759,20121122
And, the log error:
KUP-04021: field formatting error for field FIELD5_DATE
KUP-04026: field too long for datatype
Anyone have an answer for this madness?