Android Question Database Problem

hogiebaer

Active Member
Licensed User
Longtime User
i have a big problem with a customer database.

The db contains 9 tables and has a size from 10mb. One table has 24500 records and seems corrupted.
The request "select * from
where .... order by [field1],[field2] limit 100" ends with the
error "database disk image is malformed...."

And now the horror !
In one case the database doesn´t exist after the request in the file.dirdefaultexternal and in the
other try the database exist, but the size is only 28KB and 5 from 9 tables MISSING !!
(for testing i have copied the saved 10mb database back)

whats wrong ??
thx
 

hogiebaer

Active Member
Licensed User
Longtime User
yes, because in 1 table are the complete sales with date and customer. it´s an app for restaurants. and i need the table for reporting.

After installation of the app the tables empty ;)
 
Last edited:
Upvote 0

hogiebaer

Active Member
Licensed User
Longtime User
yesterday, i think an external power problem causes. the problem isn´t that the file is corrupt. this can be solved through export, create new db and import functionality.

!! The real problem is, that an easy READ request to this table with "select" KILLS/DELETE THE DATABASE or modify the physical size !!
 
Last edited:
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Here you go @hogiebaer try this, it's earlier for me to just give you this link rather then try to explain it to you. I really hope that this helps you.
http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/16_Support/Troubleshooting/Repair_SQLite_Database

I hope that the following help you for further projects.
BTW for restaurants etc my apps connect directly MySQL servers (onsite) rather than having all that data stored on a single device. If the end user is mobile (delivery company), my app stores the information locally on an SQLite database then synchronises to an MySQL database when the signal is at 50%. I just do not store large amounts of data on a single device, you never know what might happen.
 
Upvote 0

hogiebaer

Active Member
Licensed User
Longtime User
Thx Peter, it´s an easy way to repair db´s. And you are right, if you say, the amount of record could be to big; and transfer the data to another "store".
But it doen´t explain the failure

!! The real problem is, that an easy READ request to this table with "select" KILLS/DELETE THE DATABASE or modify the physical size !!
 
Upvote 0
Top