Subject AW: [firebird-support] Cannot transliterate character between character sets.
Author Olaf Kluge
Hello Tomasz,



I have created a stroed procedure to find the records. There are some with
the mm² (²) (pow) and I get the error messeage with ibexpert. But I was
wondering, our Java (jaybird) application displays me all records, also the
problematic. The charset is in every case ISO8859_1. What cen be the reason
for this difference?



Thank you.



---


Knowing nothing more except what you wrote, I'd suggest some kind of
binary search as a quick solution. Suppose your table has N records. You
iterate as follows (and should find your record in log(N) steps, of
course you put the actual number of records instead of N in the queries):
select * from the_table rows 1 to N/2;
If it fails, your record is in the first half, otherwise it's in the
second one. If the former, do
select * from table rows 1 to N/4;
and if the latter, do
select * from table rows N/2 to 3*N/4;
this will tell you the quarter your record sits in. Then you repeat the
above steps for N/8, N/16 etc., thus narrowing the range containing your
record, until you reach a 1-record range.
I know it might look complicated at first, but it's not. All other
solutions coming to my mind require some programming (at least a stored
procedure) and since you haven't written a program to find the record
yourself, I suppose for some reason you're not able or not allowed to,
so try the binary search.
Another question is, what you're gonna do with the record should you
find it? You won't see it anyway. Maybe instead of binary search based
on record number (in natural table order), you should use some other key
instead, so that you can delete the record once you find the value of
its key?
AFAIR, FlameRobin allows you to retrieve data in chunks (300-records
long by default). Using this feature, you can quickly find the
300-record range and then a 9-step binary search should give you the
exact record.

regards
Tomasz






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