Subject RE: [firebird-support] Corrupted data FB 1.5
Author RB Smissaert
Thanks, that is a really useful tip, as for now binary zero is the only
thing I can think of causing this problem, and it
seems ODBC/ADO (classic VB ADO) can't look beyond that. It is not in fact my
database that has this problem, but
one of my customers, so I will pass him this tip and report back what
happened.

RBS

_____

From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Ivan Prenosil
Sent: 30 December 2009 19:18
To: Firebird-Support
Subject: Re: [firebird-support] Corrupted data FB 1.5




> Have a case of a FB 1.5 (Classic) database on Windows where certain
records
> in two fields of one table show fine in one application, but show
truncated
> in another, that is only the first 4 characters show. First application
> accesses the database via the API and the second via ODBC.
>
> This is the schema of that table:
>
> CREATE TABLE ADDRESS(
> ADDRESS_ID INTEGER NOT NULL,
> ADDRESS_LINE_1 VARCHAR(40),
> POSTCODE CHAR(10),
> UPDATED_DATE INTEGER,
> ADDRESS_LINE_2 VARCHAR(40),
> ADDRESS_LINE_3 VARCHAR(40),
> ADDRESS_LINE_4 VARCHAR(40),
> ADDRESS_LINE_5 VARCHAR(40))
>
> The problem shows in ADDRESS_LINE_3 and ADDRESS_LINE_4, but only in a few
> records.
> ADDRESS_LINE_2 has an index, but ADDRESS_LINE_2 hasn't.
>
> The question is how to figure out what is wrong with the particular
records.
> My guess is that somehow wrong characters
> got into the text, maybe Chr(0), but I can't see it in my programming
> environment, which is VB.
> Is there a way with SQL to see what might be the trouble here?

If the problem is caused by binary zero in your data, you can find such rows
this way

SELECT * FROM ADDRESS
WHERE ADDRESS_LINE_3 CONTAINING CAST('' AS CHAR(1) CHARACTER SET OCTETS)

Ivan
http://www.volny <http://www.volny.cz/iprenosil/interbase/>
cz/iprenosil/interbase/





[Non-text portions of this message have been removed]