RE: Very strange SQL problem
Posted in 1998
----------
From: kponn@aol.com[SMTP:kponn@aol.com]
Sent: Monday, April 20, 1998 6:35 PM
We have a table with 4 char columns. The data file has the following
format:
22|John,Doe|333|Ab123456<tab>^M where <tab> is a tab (!!!) and a carriage
return.
JL: The tab does not matter very much (though it would complicate queries
without wildcards); what should matter is that you do not have a
terminating delimiter on the fourth field. The control-M might be a
nuisance; I'd be inclined to clean the data before loading it. If the data
is formatted consistently, then I would use:
tr -s '\\011\\015' '||' <input > output
I used "load from ...." command from dbaccess to load into tableA. When I
do a
select * from tableA, only first 3 columns show up. when I do select *
fromtableA where column4 matches "Ab*" , I get nothing . What's going on here?
JL: Good question. It either should not be loading at all or it should be
accepting the end-of-line as the end of the data for each record, and I
think it should be rejecting the data.
For a data file, does it matter if we have tab at the end or not.
JL: Not really; it introduces data you probably don't want into the DB, but
that shouldn't break the load.
If it is a
problem, why wouldn't informix complain instead of loading.
JL: That is a very relevant question; I think it should be complaining.
We are using ODS 7.13 UC2 on solaris 2.4.
JL: Humph. That shouldn't be having this sort of problem.
Yours,
Jonathan Leffler (jleffler@visa.com) #include <bother.ms-exchange.h>