0
내가 여기처럼 내 데이터베이스에 어떤 값을 삽입하려고 ':SQLiteConstraintException 오류 코드 19
ContentValues cv = new ContentValues();
cv.put(ID, adv.getId());
cv.put(NAME, adv.getName());
cv.put(COUNTRY, country);
db.insert(TABLE_NAME, null, cv);
을하지만 다음과 같은 오류 받고 있어요 : 여기
E/SQLiteDatabase(19920): Error inserting id=14024 name=Banorte Generali Country=Mexico E/SQLiteDatabase(19920): android.database.sqlite.SQLiteConstraintException: TableName.Countrytext may not be NULL (code 19)
은 창조의 코드 데이터베이스의 :
db.execSQL("create table " + TABLE_NAME + " (" + ID
+ " integer primary key not null,"
+ NAME + " text, " + COUNTRY +
" text not null"
+ ");");
내가 뭘 잘못하고 있니? 삽입 값이 null인지 확인했지만 중복되지 않았는지, 테이블이 비어 있는지, 제안 사항이 있습니까?
.trim() 뒤에 빈 문자열이 있는지 확인 했습니까? – wtsang02
예, 내가 디버그에서 확인하고 입력이 null이 아닙니다 – CarlosT
빈 문자열과 null이 다릅니다. – wtsang02