How to use %?% in sqlite prepared statements for Android -
currently query this
cursor c = db.query(content_table, new string[]{"content"}, "content %?%", new string[]{keyword}, null, null, null);
what want write prepared statement, surrounded % sign. logcat
android.database.sqlite.sqliteexception: near "%": syntax error (code 1): , while compiling: select content `const` content %?%
how do properly?
i used
cursor c = db.query(content_table, null, "content ?", new string[]{"%" + keyword + "%"}, null, null, null);
and worked fine
Comments
Post a Comment