mercredi 9 septembre 2015

How can I add where selection which variable type is Text in sqlite query?

When I want to select data which where conditions type Text, there is a problem. But I change the where conditions type is Integer the problem goes away. Is there a problem to add select statement a Text where clause?

 Cursor cursor= sqLiteDatabase.query(tableName,columns,"Id=9" ,null,null,null,null);   this query is working very well But;
 Cursor cursor= sqLiteDatabase.query(tableName,columns,"whichWeek=Week 5" ,null,null,null,null);   this is not working. I don't understand :(


        db.execSQL(
                "create table "+tableName+" ( "
                        +Id+" integer primary key autoincrement,"+
                        evName+ " text not null,"+
                        depName+ " text not null,"+
                        evGol+ " integer,"+
                        depGol+" integer,"+
                        whichWeek+ " text not null );"
        );

Aucun commentaire:

Enregistrer un commentaire