Here's a line from the unl file that was created using unload:
10010|INVALID CODE|
Here's the schema of the table it's to go into:
create table "informix".tax_exp
(
decode char(5),
description varchar(250)
);
revoke all on "informix".tax_exp from "public";
Here's the dbload command file and command:
dbload -d ri -c command.sql -l dbload_err -e 9
FILE tax_exp.unl DELIMITER '|' 2;
insert into tax_exp (decode, description) VALUES (f01, f02);
OR
FILE tax_exp.unl DELIMITER '|' 2;
insert into tax_exp;
and heres' the ouput:
In INSERT statement number 1 of raw data file tax_exp.unl.
Row number 3 is bad.
10010|INVALID CODE| ...
The # of fields in the load file does not match the # on the FILE line
I'm using 9.21.TC4 on NT.
The dbload works if I take off the ending pipe. There appears to be a
newline character after the last pipe. Seems like it should work but
it doesn't.
Is the newline character both the final field delimiter and row
delimiter in this version?
dbload -V
INFORMIX-SQL Version 9.20.UC1
Thanks
Are you sure that you don't have something else on the end of that line -
something unprintable - that the loader is trying to interpret?
bru...@real-info.com (Bruce Schreiber) on 29/11/2001 09:31:21
Please respond to bru...@real-info.com (Bruce Schreiber)
To: inform...@iiug.org
cc: (bcc: Gerry Sturkenboom/ham/LIC)
Subject: dbload sees too many pipes...
cheers
j.
cut -f 1,2 -d "|" unload_filename > newfile
which will give you
10010|INVALID CODE
field1|field2
field1|field2
etc......
The try "newfile" as your load file
You can also add a trailing pipe to newfile if you want
Dirk
OR
and heres' the ouput:
Thanks
==========================================================
This message contains information intended for the perusal, and/or use (if
so stated), by the stated addressee(s) only. The information is
confidential and privileged. If you are not an intended recipient, do not
peruse, use, disseminate, distribute, copy or in any manner rely upon the
information contained in this message (directly or indirectly). The sender
and/or the entity represented by the sender shall not be held accountable
in the event that this prohibition is disregarded. If you receive this
message in error, notify the sender immediately by e-mail, fax or telephone
representations contained in this message, whether express or implied, are
those of the sender only, unless that sender expressly states them to be
the views or representations of an entity or person, who shall be named by
the sender and who the sender shall state to represent. No liability shall
otherwise attach to any other entity or person.
==========================================================