Документация sqlitecpp предлагает
// Compile a SQL query, containing one parameter (index 1)
SQLite::Statement query(db, "SELECT * FROM test WHERE size > ?");
// Bind the integer value 6 to the first parameter of the SQL query
query.bind(1, 6);
// Loop to execute the query step by step, to get rows of result
while (query.executeStep())
{
//.... do stuff with e.g. query.getColumn()
}
Таким образом, вы должны построить свой запрос, используя ?
для переменной, а затем выполнить query.bind(1,sym)