I'm using a Java wrapper for accessing Sqlite but I assume this is a general Sqlite question.
String stmt = "SELECT foo FROM bah WHERE foo='%/?/%';
PreparedStatement a = myConn.prepareStatement(stmt);
a.setString(1, "hello");
a.executeQuery();
... throws an exception - it doesn't like the ? being inside quotes. Everything is fine if I do
...WHERE foo=?
but this isn't the statement I want.
How can I insert a variable into such a prepared statement? If you forget about the fact I'm using Sqlite, how is this is done using other database technologies?