26197: Reached maximum error limit during load: (1). when trying to select from external table
Posted in 2022
Gilles NJOH TCHAPPI got error 26197 (maximum error limit reached) selecting from an external table; the reject file showed TOO_MANY_FLDS. Paul Watson suggested an embedded delimiter; Mike Walker suggested stray characters, trailing spaces or carriage returns and using od -c, tr or dos2unix. Solved: the file was DOS formatted, and dos2unix fixed it.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Topics: Server Administration, Security, Permissions & Auditing, Data Types & Schema Design
Hi,
while trying to select data from external table, we encountered following errors message :
#
echo "select count(*) from mytable_ext;" | dbaccess $DBNAME
Database selected.
26197: Reached maximum error limit during load: (1).
Error in line 1Near character position 38
Database closed.
See uploaded external table definition, and the the log file errors below
create external table "informix".mytable_ext
(
num_int_tc integer,
num_uat varchar(17),
reference varchar(17),
cod_pro varchar(17),
cod_cou varchar(17),
cod_tai varchar(17),
dd decimal(32,15),
tva decimal(32,15),
uvc integer,
typedecl varchar(255),
soustype varchar(255),
nrdeclaration bigint,
tauxdouane decimal(32,15),
codepref integer,
datedeclare varchar(25)
)
using
(
datafiles
(
"DISK:/tmp/myfile.txt"
),
format "delimited",
DELIMITER "|",
rejectfile "/tmpp/myfile.log",
maxerrors 150,
escape off
);
revoke all on "informix".mytable_ext from "public" as "informix";informix:/tmp/# cat myfile.log
/tmp/myfile.txt~1~TOO_MANY_FLDS~<none>~672854|46GAR22FRCH1228|GD81930|1415857|GRF|TU|.083333333333333|6.958333333333333|360.0000000|IM|C|2200011008||100|0~/01/2022|
Can someone help, please
Best regards
------------------------------
Gilles NJOH TCHAPPI
------------------------------
#Informix
TOO_MANY_FLDS - look for an embedded delimiter in your data Cheers Paul
Take a look at that last field that shows the "~" in it - is that what you expect? There may be a funky character in the file. Also make sure that that there are no spaces at the end of the record in the file being loaded, or an extra newline or carriage return. Pipe the first line of the file through od -c to look for non-ascii characters. ------------------------------ Mike Walker xDB Systems, Inc www.xdbsystems.com ------------------------------
If you transferred the file from another server, esp. a Windows computer, then there may well be additional characters in the file, including additional carriage returns at the end of each line. Remove with a "tr" command or "dos2unix" (if installed). ------------------------------ Mike Walker xDB Systems, Inc www.xdbsystems.com ------------------------------
Hi Paul Thanks a lot for your answer. I had already look for embedded delimiter in the data and found no extra delimiter in the data Fortunately I found the cause. The server I'm working on is a Linux server but the file I was trying to select data from was DOS formatted. Just using dos2unix to convert the file resolve the issue Best regards This e-mail and any attachment are confidential and intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. Unauthorized publication, use, dissemination, forwarding, printing or copying of this e-mail and its associated attachments is strictly prohibited. Let's respect the environment together. Only print this message if necessary.
Hi You are right. The server I work on is a Linux server and the file I was trying to select data from was dos formatted. I ran dos2unix on the fille and this effectively fixed the issue. Thanks a lot Best regards This e-mail and any attachment are confidential and intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. Unauthorized publication, use, dissemination, forwarding, printing or copying of this e-mail and its associated attachments is strictly prohibited. Let's respect the environment together. Only print this message if necessary.