1

I have a db table :

create table recentMovies5  (_id integer primary key autoincrement, line1 text, line2 text, title text , Tags text , ImageLink text , XMLLink text, entryTime numeric);

and am inserting values like this:

Insert into recentMovies5 (line1, line2, title, Tags,ImageLink,XMLLink,entryTime) Values ("3 min ", "Japan", "Ahsan", "38", "www.ahsan.com/aha.jpg", "www.ahsan.com/aha.xml",1317172213);

java code for inserting:

            String select="Insert into recentMovies5 (line1, line2, title, Tags,ImageLink,XMLLink,entryTime) Values (\"3 min \", \"Japan\", \"Ahsan\", \"38\", \"www.ahsan.com/aha.jpg\", \"www.ahsan.com/aha.xml\",1317172213)";
            SQLiteDatabase db = savedInfoDbHelper.getReadableDatabase();
            Cursor c=db.rawQuery(select, null);
            startManagingCursor(c);

before I added the column entryTime numeric, everything was working fine. Now, no data is being inserted and I get no error message! Any help ?

edit 1: changing entryTime from numeric to integer doesnt seem to help :(

edit 2: using this code to open the database:

public SavedMoviesDbAdapter open() throws SQLException {
    dbHelper = new RecentMovieDatabaseHelper(context);
    database = dbHelper.getWritableDatabase();
    return this;
}

edit 3: checked with both isOpen and isReadOnly =>> is open and not readonly.

1 Answer 1

1

You are trying to insert into a readable only DB.

Use openDatabase with OPEN_READWRITE flag instead.

Sign up to request clarification or add additional context in comments.

1 Comment

also, I used to be able to insert only some times back when I didnt have the column timeEntry ...

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.