Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread SQL code needed
Sat, Jan 6 2007 5:35 PMPermanent Link

Jerry Blumenthal
A user just sent me his database which has serious corruption, not able
to be handled by repair table.  There are records which are just
garbage, and there are a lot of them mixed in with good data.  I need
some SQL code to delete all records that dont look ok.

How would the following be?  Or is there something better?

DELETE FROM "c:\zz\table1.dat" WHERE
(Num < 1) or (Num IS NULL) or (Num > 500000)

Jerry
Sat, Jan 6 2007 7:24 PMPermanent Link

Jerry Blumenthal
Jerry Blumenthal wrote:
> A user just sent me his database which has serious corruption, not able
> to be handled by repair table.  There are records which are just
> garbage, and there are a lot of them mixed in with good data.  I need
> some SQL code to delete all records that dont look ok.
>
> How would the following be?  Or is there something better?
>
> DELETE FROM "c:\zz\table1.dat" WHERE
> (Num < 1) or (Num IS NULL) or (Num > 500000)
>
> Jerry


When I try the above SQL code, about 80% through the file, I get error
message 8965: Index Page buffers corrupt".  Running repairtable on the
file does not change that.

I tried going into DBSYS and deleting by hand, but I got an "invalid
floating point operation" error, and could not get off the record or out
of the program.  Finally I closed DBSYS with Task Manager.

Jerry
Sat, Jan 6 2007 10:26 PMPermanent Link

"Robert"

"Jerry Blumenthal" <jerry@blumenthalsoftware.com> wrote in message
news:EC17BD71-55E6-4FC8-B7F7-2E9A98B666A3@news.elevatesoft.com...
> Jerry Blumenthal wrote:
>> A user just sent me his database which has serious corruption, not able
>> to be handled by repair table.  There are records which are just garbage,
>> and there are a lot of them mixed in with good data.  I need some SQL
>> code to delete all records that dont look ok.
>>
>> How would the following be?  Or is there something better?
>>
>> DELETE FROM "c:\zz\table1.dat" WHERE
>> (Num < 1) or (Num IS NULL) or (Num > 500000)
>>
>> Jerry
>
>
> When I try the above SQL code, about 80% through the file, I get error
> message 8965: Index Page buffers corrupt".  Running repairtable on the
> file does not change that.
>
> I tried going into DBSYS and deleting by hand, but I got an "invalid
> floating point operation" error, and could not get off the record or out
> of the program.  Finally I closed DBSYS with Task Manager.
>

Try deleting the IDX file and letting DBISAM recreate it. At this point,
having the right indexes is the least of your problems.

Robert


Image