Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

problem about sqlite database, no such table:

Tags:

android

sqlite

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?

like image 765
user275788 Avatar asked Feb 26 '10 14:02

user275788


People also ask

What is the main limitation of SQLite?

An SQLite database is limited in size to 281 terabytes (248 bytes, 256 tibibytes). And even if it could handle larger databases, SQLite stores the entire database in a single disk file and many filesystems limit the maximum size of files to something less than this.

How do I view tables in SQLite?

If you are running the sqlite3 command-line access program you can type ". tables" to get a list of all tables. Or you can type ". schema" to see the complete database schema including all tables and indices.

How many tables can SQLite handle?

Maximum Number Of Tables In A Join SQLite does not support joins containing more than 64 tables. This limit arises from the fact that the SQLite code generator uses bitmaps with one bit per join-table in the query optimizer.


1 Answers

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 : /data/data/com.SGMalls/databases/mallMapv2.sqlite

If you are attempting to copy the file in SQLiteOpenHelper's 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.

like image 76
CommonsWare Avatar answered Oct 18 '22 17:10

CommonsWare