mardi 29 mars 2016

Sqlite Database Error : SQLiteLog: (1) near "s": syntax error

I'm having trouble figuring out what this error means: SQLiteLog: (1) near "s": syntax error Mostly because I can't find the database it's running off.

I'm building a movie database android app and the database file I have in my raw directory remains the same and I can't find the DB the build is running off of to fix this.

When using the OMDB api so movies will add to my local database and some will not.

The command I'm using to add is:

MovieDB db = new MovieDB((Context) this);
SQLiteDatabase movDB = db.openDB();
String insert = "insert into movies values('" + movie.title + "','" + movie.year + "','" + movie.rated + "','" + movie.released + "','" + movie.runtime + "','" + movie.genre + "','" + movie.actors + "','" + movie.plot + "',null);";
movDB.execSQL(insert);

I have a feeling it has to do will the null at the end because in my database I have a self incrementing ID which I figured if I passed null it would just assign a value.

Any insight would be much appreciated!

Aucun commentaire:

Enregistrer un commentaire