jeudi 5 mars 2015

Special chars in select

i have select that looks like this



mSelectionClause = "(lower(" + NAME_COLUMN + ") LIKE \'%" + name.toLowerCase() + "%\'";


however when i set name to something like '" app crash with



Caused by: android.database.sqlite.SQLiteException: near ""%' OR upper(display_name) LIKE '%'''''"": syntax error (code 1): , while compiling: (...)


how can i prevent from special chars in value to select?


Aucun commentaire:

Enregistrer un commentaire