hi all,
I have problems running a dynamic LIKE statement in my project: this query works like a charm and returns all items with a 't' in there name:
const char *sql = "select * from bbc_ipad_v1_node where name LIKE '%%t%%'";
When I try to do this dynamically I do not get erros, but just an empty result. It seems that the value is nill. I try to bind a string value 's' which outputs a correct value
NSLog(@"bbc_ : search menu items from db based on: %@",s);
const char *sql = "select * from bbc_ipad_v1_node where name LIKE '%%?%%'";
sqlite3_stmt *statement;
if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL) == SQLITE_OK) {
sqlite3_bind_text(statement, 1, [s UTF8String],-1,SQLITE_TRANSIENT);
How should I bind this value instead of using:
const char *sql = "select * from bbc_ipad_v1_node where name LIKE '%%?%%'";
Thomas