Re: [sqlite] How to use LIKE wildcards and bound parameters?

2011-06-18 Thread Zettai Muri
> Have the C program include the % in the text parameter: > > sqlite3_bind_text( stmt, >        sqlite3_bind_parameter_index(stmt, "%:bp%"), >               "%bar%", .. Just out of interest would there be a way to use a variable here with the % wildcards as in: char* myvar = "teststr"; sqlite

[sqlite] How to use LIKE wildcards and bound parameters?

2011-06-18 Thread Zettai Muri
Hi All, Could someone tell me how to use bound parameters with LIKE and where the % wildcards should be placed? I currently have the following code extract: char *sql = "SELECT * FROM foo WHERE name LIKE :bp"; rc = sqlite3_prepare_v2(db, sql, strlen(sql), &stmt, &tail); sqlite3_bind_text( stmt,