How do you check if a column value in a SQLite database is null if it is of type Blob?
I get the cursor as follows:
public Cursor fetchArticle(int i) throws SQLException { Cursor mCursor = mDatabase.query(true, "api_content", new String[] { "_id", "ArticleName", "ArticleText","ImageLink", "Image" }, KEY_ID + "=" + i, null, null, null, null, null); if (mCursor != null) { mCursor.moveToFirst(); } return mCursor; }
How to check if the value of the Image, index 4 column is null? I tried the following:
- Using the isNull () method, which always returns false when in fact the value should certainly be null
- Using
articleCursor.getBlob(4) == null
, where articleCursor
is a valid cursor (returns false)
To complicate matters even further when I print out articleCursor.getBlob(4)[0]
, it returns values ββlike 78
or 91
that are not like something that I consider null
.
And again, it is not possible for the database to have any data in this column; it must be zero. Any ideas? Thanks!
source share