title: android.database.sqlite.SQLiteException: near ";": syntax error (code 1):
body: <p>I am getting this error when I am trying to delete a record from the database.   Here is the error in full</p>
  
  <pre><code>FATAL EXCEPTION: main
                                                                                Process: itp231.dba.nyp.com.bloommain, PID: 12274
                                                                                android.database.sqlite.SQLiteException: near ";": syntax error (code 1): , while compiling: DELETE FROM events WHERE id= ;
                                                                                    at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
                                                                                    at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:887)
                                                                                    at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:498)
                                                                                    at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
                                                                                    at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:58)
                                                                                    at android.database.sqlite.SQLiteStatement.&lt;init&gt;(SQLiteStatement.java:31)
                                                                                    at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1674)
                                                                                    at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1605)
                                                                                    at itp231.dba.nyp.com.bloommain.EventInformationPage$1.onClick(EventInformationPage.java:135)
                                                                                    at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:163)
                                                                                    at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                    at android.os.Looper.loop(Looper.java:148)
                                                                                    at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  </code></pre>
  
  <p>Looking at the log, it directed me to this line of codes (my deleteRecord() method - </p>
  
  <pre><code>private void deleteRecord() {
      AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
      alertDialogBuilder.setMessage("Are you sure you want delete this person?");
  
      alertDialogBuilder.setPositiveButton("Yes",
              new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface arg0, int arg1) {
                      String id = editTextId.getText().toString().trim();
  
                      String sql = "DELETE FROM events WHERE id= " + id + ";";
                      db.execSQL(sql);
                      Toast.makeText(getApplicationContext(), "Record Deleted", Toast.LENGTH_LONG).show();
                      c = db.rawQuery(SELECT_SQL,null);
                  }
              });
  </code></pre>