2

I'm getting SQLiteBlobTooBigException exception when fetching data from table.

Here is stacktrace :

 Caused by android.database.sqlite.SQLiteBlobTooBigException: string or blob too big (code 18)
   at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(SQLiteConnection.java)
   at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:968)
   at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836)
   at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
   at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:143)
   at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:133)
Faraz
  • 2,144
  • 1
  • 18
  • 28

1 Answers1

0

I found how to use length() and substr() to request only 1MB (the max for CursorWindow is 2MB), maybe it will help. Also, you could use context.getContentResolver().query() with a selection that only includes the relevant columns, that way you won't load data related to the other (unnecessary) columns.