안드로이드를 사용하여 SQLite 데이터베이스에서 null 값을 가져 오는 데 문제가 있습니다.안드로이드 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 내 예에 따라 작동하는 코드를 제공 할 수 있습니다 :
나는 확인하고 싶다.
간략한 설명도 환영합니다. 감사합니다.
welcome to stackoverflow –