0

I am deleting the student records continuously based on student enrollment id

I am having 1000 id's I am deleting continuously as shown below..

for (int j = 0; j < feeDetailsArrayList.size(); j++) {
               FeeDetails feeDetails = feeDetailsArrayList.get(j);
                           dbHelper.deleteFeeDetailsTableRecords(feeDetails.getStudentEnrollmentId());
        }

public  void deleteFeeDuesTableRecords(String studentEnrollmentId){

    SQLiteDatabase db = this.getWritableDatabase();
    String selectQuery = "delete from "+ STUDENT_FEE_DUES_TABLE +" where "+ KEY_STUDENT_ENROLLMENT_ID + "  = " + "'" + studentEnrollmentId + "'";
    Cursor cursor = db.rawQuery(selectQuery, null);


}

It will shows following error

fillWindow() exception unable to open database file (code 14)
android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14)
at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method)
at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:854)
at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836)

what was the problem am not able to trace,can any one guide me Your response will be appreciated.

2
  • The code in your question seems to be missing the actual error location, namely the fillWindow() method. Also: You got an "unable to open database file" error, hence: Show us the code that opens the database. Most likely this is an permission issue (e.g. wrong path for db file)
    – dhke
    Jan 7, 2016 at 9:51
  • @pskink,@dhke Thanks for response.The issue is Fixed by the using sql IN(id1,id2...idn) Jan 7, 2016 at 11:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.