I created several tables in the application
and all worked well. after that I am trying to add one more table with the same approach but it always gives following error
android.database.sqlite.SQLiteException: no such table: patients_record (code 1): , while compiling: SELECT * FROM patients_record at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) Here is the query of the table.
private static final String PATIENT_TABLE_CREATE = "create table if not exists patients_record( patientId text primary key not null, "
+ "patientFirstName text not null, patientLastName text not null, patientDepartment text not null, patientDoctorId text not null, patientRoom text not null );";
I added the string to onCreate()
of Database
Handler with other tables
that are created previously.