Answer the question
In order to leave comments, you need to log in
Why does a SQLite query sometimes return an empty result?
The application uses a SQLite database with 13 columns.
When columns from 1st to 7th are used in the request parameters for getting or deleting a note, the request passes, if from 8th to last - 0 rows are always returned.
Let's say here is the query when searching the db
private NoteCursorWrapper querySeach(String stringSearch) {
Cursor cursor = mDatabase.query(
NoteTable.NAME_NT,
null, //Columns - select all columns
NoteTable.Cols_note.TITLE_N + " LIKE ? OR " + NoteTable.Cols_note.TEXT_N + " LIKE ?",
new String[] {"%"+ stringSearch + "%", "%"+ stringSearch + "%"},
null, //groupBy
null, //having
NoteTable.Cols_note.DATE_CREATED_N + " DESC"//
);
return new NoteCursorWrapper(cursor);
}
private NoteCursorWrapper querySeach(String stringSearch) {
Cursor cursor = mDatabase.query(
NoteTable.NAME_NT,
null, //Columns - select all columns
NoteTable.Cols_note.ENCRYPT_STATUS_N + " =? ",
new String[] {"1"},
null, //groupBy
null, //having
null//
);
return new NoteCursorWrapper(cursor);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question