본문 바로가기

Develop/Android

SQLite3 error

 

android.database.sqlite.SQLiteConstraintException: error code


이 문제는 SQLite3 를 사용하여 DB를 조작하는데 insert 문을 사용할때 생겼던 error 로
삽입하고자 하는 table 에 삽입하려는 값이 중복되어 나타나는 error 였습니다.

(primary key 가 중복이 일어났었죠..)

해결방법으로는 insert 쿼리에서 중복이 일어나는 값의 primary key 를 where 조건문을 이용해 해당 행을 삭제하고 삽입하여 문제를 해결했습니다.

 

'Develop > Android' 카테고리의 다른 글

eclipse - failed to create the java virtual machine 에러  (0) 2013.04.15
Invalid file name: must contain only [a-z0-9_.]  (0) 2013.04.12
SQLite3 error  (0) 2011.12.12
안드로이드 특징  (0) 2011.11.22
안드로이드 구조  (0) 2011.11.22