I have some code that works judt fine when I do a simple 'select' statement :
const char *sql = "SELECT * FROM aliments WHERE nom_alm = ?;
sqlite3_stmt *statement;
if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL) == SQLITE_OK) {
sqlite3_bind_text(statement, 1, [nameToSearch UTF8String], -1, SQLITE_TRANSIENT);
....
The same code with the sql query : "SELECT * FROM aliments WHERE nom_alm LIKE '%?%'" returns nothing instead of 3 rows, as verified with a GUI client.
Is there something I should now regarding "sqlite3_bind_text" when we do a "SELECT LIKE" statement ?
Thanks.
Pinus.
const char *sql = "SELECT * FROM aliments WHERE nom_alm = ?;
sqlite3_stmt *statement;
if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL) == SQLITE_OK) {
sqlite3_bind_text(statement, 1, [nameToSearch UTF8String], -1, SQLITE_TRANSIENT);
....
The same code with the sql query : "SELECT * FROM aliments WHERE nom_alm LIKE '%?%'" returns nothing instead of 3 rows, as verified with a GUI client.
Is there something I should now regarding "sqlite3_bind_text" when we do a "SELECT LIKE" statement ?
Thanks.
Pinus.