У меня проблема при редактировании и добавлении базы данных
Я пытался отредактировать и найти проблему, но не смог найти решение
public boolean insert_dealer(get_set_db dealer){
ContentValues Values = new ContentValues();
Values.put(My_data.dealer_CLN_NMEA , dealer.getName());
Values.put(My_data.dealer_CLN_description , dealer.getDescribe());
Values.put(My_data.dealer_CLN_image , dealer.getImage());
Values.put(My_data.dealer_CLN_WHOLESALE , dealer.getWholesale());
Values.put(My_data.dealer_CLN_INDIVIDUAL , dealer.getAn_individual());
long result = database.insert(My_data.dealer_TB_NAME,null,Values);
return result != -1;
}
Подробности логов
2019-07-11 09:28:44.341 31418-31418/com.example.dealer E/SQLiteLog: (1) near "individual": syntax error
2019-07-11 09:28:44.348 31418-31418/com.example.dealer E/SQLiteDatabase: Error inserting image=kcc An individual=3.0 describe=othman wholesale=2.0 Name=ott
android.database.sqlite.SQLiteException: near "individual": syntax error (code 1 SQLITE_ERROR): , while compiling: INSERT INTO dealerr(image,An individual,describe,wholesale,Name) VALUES (?,?,?,?,?)
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:903)
at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:514)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1562)
at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1433)
at com.example.dealer.DatabaseAccess.insert_dealer(DatabaseAccess.java:49)
at com.example.dealer.Main2Activity.onOptionsItemSelected(Main2Activity.java:154)