0
이 데이터베이스 테이블 작성하는 내 코드입니다 :안드로이드 SQLiteOpenHelper : "작성"근처 오류 코드 = 1, MSG = : 구문 오류
public void onCreate(SQLiteDatabase db) {
Log.i(TAG, "Inizio creazione database MessagesDB");
String CREATE_TABLE = "CREATE TABLE " + TABLE2 + " (" + Key_key + " TEXT PRIMARY KEY, " + Key_ID + " INTEGER NOT NULL, " + Key_author + " TEXT NOT NULL, "
+ Key_date_create + " TEXT NOT NULL, " + Key_sender + " TEXT, "
+ Key_date_sent + " TEXT, " + Key_recipient + " TEXT, "
+ Key_date_received + " TEXT, " + Key_message + " TEXT, "
+ Key_message_path + " TEXT, " + Key_size + " INTEGER" + ");";
try {
db.execSQL(CREATE_TABLE);
Log.i(TAG, "Creazione database MessagesDB avvenuta con successo");
}
catch (Exception e){
Log.e(TAG, "Errore nella create table messages", e);
}
}
하지만 난 로그 캣에 오류가 있습니다
:Errore nella create table messages
:android.database.sqlite.SQLiteException: near "create": syntax error: CREATE TABLE messagesDB (_key TEXT PRIMARY KEY, _id INTEGER NOT NULL, author TEXT NOT NULL, date create TEXT NOT NULL, sender TEXT, date_sent TEXT, recipient TEXT, date_received TEXT, message TEXT, message_path TEXT, size INTEGER);
을
왜이 오류가 발생하는지 이해가되지 않습니다. 누군가 나를 이해시키는 데 도움이 될 수 있습니까? (영어 불쾌) 죄송합니다.
대단히 감사합니다. 넌 나를 구했다! :) – smanulla