Android を使用して SQLite データベースから null 値を取得できません。
私のデータベースには 10 列あります。1 列目から 8 列目まですべて値が入力されています。ただし、9 列目と 10 列目の値が null または何らかの数値である行がいくつかあります。
確認したい:
String selectQuery = "SELECT * FROM products WHERE barcodeId='" + id + "'";
Cursor myCursor = db.rawQuery(selectQuery, null);
if (myCursor.moveToFirst()) {
//checking to see if there is something in column 9
if(myCursor.getString(8) != null){
// do soemthing
}else {
// if there is nothing do something
}
//checking to see if there is something in column 10
if(myCursor.getString(9) != null){
// do soemthing
}else {
// if there is nothing do something
}
}
私のテーブルの列9と10を使用して、私の例に従って作業コードを提供できますか。
簡単な説明も歓迎します。ありがとう