problem about sqlite database, no such table:
I open a sqlite database and use rawquery to get data.
But the log.e show the information:
android.database.sqlite.SQLiteException: no such table: types:
But, I really have this table.
And i also try to use the other sql ,But also get the error message such as
android.database.sqlite.SQLiteException: no such table: malls:
I am sure there are this two tables.
So why get the error message?
6 Solutions collect form web for “problem about sqlite database, no such table:”
If this is on the emulator, use DDMS File Explorer or
adb pull to download a copy of the database file and confirm its contents.
And i crate a custom SQLiteOpenHelper
to copy this file to path :
If you are attempting to copy the file in
onCreate(), you are too late. I would do it before then.
So the copy file code may be can not
copy the complete file.
It is more likely you would get an error about a corrupt file in that case.
This should help.
If you have multiple contents providers, you might think that your table exists while it does not. In which case the error you are getting is legitimate.
Take a look here for details and solution:
Some people have been able to solve the problem using the steps mentioned here. It seems to me that this problem exists on certain versions of Android 2.2. I have incorporated this change in my code, though I’m still looking for Beta testers with to see if it actually works.
I think this error occurs when you change the table structure. To solve this, clean the data
(Settings -> Manage application -> Clear data) before installing the new application.
SQLiteDatabase.execSQL() interpretation takes a single string sql, ending with “;”. Two lines have not interpreted.
Creating tables in a few lines sql just not executed.