android.database.sqlite.SQLiteException: near ",": syntax error (code 1): , while compiling -


android.database.sqlite.sqliteexception: near ",": syntax error (code 1): , while compiling: select id, title, tagline, overview, release_date, vote_average, popularity, posterpath, runtime, genres, cast, crew, follow, notified moviesnowplaying 

.

@override public cursor query(uri uri, string[] projection, string selection, string[] selectionargs, string sortorder) {      sqlitequerybuilder querybuilder = new sqlitequerybuilder();      switch (urimatcher.match(uri)) {         case uricodenowplaying:             querybuilder.settables(moviesschema.moviesnowplaying.table_name);             break;          case uricodeupcoming:             querybuilder.settables(moviesschema.moviesupcoming.table_name);             break;          case uricodepopular:             querybuilder.settables(moviesschema.moviespopular.table_name);             break;       default:             throw new illegalargumentexception("unknown uri " + uri);     }      cursor cursor = querybuilder.query(sqldb, projection, selection, selectionargs, null, null, sortorder);      cursor.setnotificationuri(getcontext().getcontentresolver(), uri);     return cursor; } 

.

static interface moviesnowplaying {      string table_name = "moviesnowplaying";      string create_db_table = " create table if not exists " + table_name             + "(" + id + " integer primary key, "             + title + " text, "             + tagline + " text, "             + overview + " text, "             + release_date + " text, "             + vote_average + " real, "             + popularity + " real, "             + poster_path + " text, "             + runtime + " integer, "             + genres + " text, "             + cast + " text, "             + crew + " text, "             + follow + " integer, "             + notified + " integer );";  }   public static cursor getmovies(uri uri, context context){      string[] projection = new string[]{moviesschema.id, moviesschema.title, moviesschema.tagline,             moviesschema.overview, moviesschema.release_date, moviesschema.vote_average,             moviesschema.popularity, moviesschema.poster_path, moviesschema.runtime,             moviesschema.genres, moviesschema.cast, moviesschema.crew,             moviesschema.follow, moviesschema.notified};      return context.getcontentresolver().query(uri, projection, null, null,null); } 

cast sqlite keyword. you'll need change name of column.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -