spicysudhi
Programmer
Hi
below is from my text file, saved in ANSI format.
700025,"Martin Bulíþ","."
700024,"CORECT Beránek s.r.o.","."
The database is NLS_CHARACTERSET = AL32UTF8 and NLS_NCHAR_CHARACTERSET = AL16UTF16
Below is extenal table script:
CREATE TABLE ALCM
(
ICCUST NUMBER(6),
ICCNAME VARCHAR2(90),
ICADD1 VARCHAR2(90)
)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY BPCSUN
ACCESS PARAMETERS
(
RECORDS DELIMITED BY NEWLINE
BADFILE LOG:'alcm.bad'
DISCARDFILE LOG:'alcm.dis'
LOGFILE LOG:'alcm.log'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
Missing field values are null
)
LOCATION (BPCSUN:'ALCM.DAT')
)
REJECT LIMIT UNLIMITED
LOGGING
NOCACHE
NOPARALLEL;
When I query the table, I get error message
"KUP-04021: field formatting error for field ICCNAME
KUP-04037: terminator not found
KUP-04101: record 1 rejected in file D:\ALCM.DAT
The first line is getting rejected due to the presence of the character "í" in it, which Oracle treats as line terminator!
How get around this?
Note: If I save the file as UTF8 (open in notepad and Save As with option UTF8) then there is no error.
regards,
Sudhi
below is from my text file, saved in ANSI format.
700025,"Martin Bulíþ","."
700024,"CORECT Beránek s.r.o.","."
The database is NLS_CHARACTERSET = AL32UTF8 and NLS_NCHAR_CHARACTERSET = AL16UTF16
Below is extenal table script:
CREATE TABLE ALCM
(
ICCUST NUMBER(6),
ICCNAME VARCHAR2(90),
ICADD1 VARCHAR2(90)
)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY BPCSUN
ACCESS PARAMETERS
(
RECORDS DELIMITED BY NEWLINE
BADFILE LOG:'alcm.bad'
DISCARDFILE LOG:'alcm.dis'
LOGFILE LOG:'alcm.log'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
Missing field values are null
)
LOCATION (BPCSUN:'ALCM.DAT')
)
REJECT LIMIT UNLIMITED
LOGGING
NOCACHE
NOPARALLEL;
When I query the table, I get error message
"KUP-04021: field formatting error for field ICCNAME
KUP-04037: terminator not found
KUP-04101: record 1 rejected in file D:\ALCM.DAT
The first line is getting rejected due to the presence of the character "í" in it, which Oracle treats as line terminator!
How get around this?
Note: If I save the file as UTF8 (open in notepad and Save As with option UTF8) then there is no error.
regards,
Sudhi