Diego Souza <[EMAIL PROTECTED]> wrote: > I wasn't able to figure this out. I'm trying to execute a query like > this: > > SELECT columns FROM table WHERE column LIKE ? > > However, I'd like to use % or _ placeholders. For instance in the > following > code: > > sqlite3_prepare_v2(db, "SELECT columns FROM table WHERE column LIKE > ?", -1, stmt, 0); sqlite3_bind_text16(stmt, 1, "myutf16txt", bytes, > SQLITE_STATIC); > > How do I insert the % stuff ?
You can make them part of the parameter value: sqlite3_bind_text16(stmt, 1, "%myutf16txt%", bytes, SQLITE_STATIC); Or, you can change the statement to something like this: SELECT columns FROM table WHERE column LIKE '%' || ? || '%'; Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users