Below is the query that I use to get the int value corresponding to a specific field in my sqlite db table.
"SELECT conn_status FROM profiles WHERE devID = '" + id+"'"
If conn_status does not have a value that matches the provided devID, then the existing value in the table will be zero. I am retrieving data from java as shown:
c.getInt(c.getColumnIndex("conn_status"))
The problem here is that with this query, c.getInt returns 0, even if the value existing in the field is null. How can I change this query so that it returns a different value instead of 0, for example 5, if the value is null.
Any help is appreciated.
source
share