SQLite problem with some parameterized queries
- by Trevor Balcom
I am having some trouble using SQLite and parameterized queries with a few tables. I have noticed some queries using the "SELECT * FROM Table WHERE row=?" are returning 1 row when there should be more rows returned. If I change the parameterized query to "SELECT * FROM Table WHERE row='row'" then the correct number of rows is returned.
Does anyone know why sqlite3_step would return only 1 row when using a parameterized query vs. using the same query in a traditional non-parameterized way?
I am using a very thin C++ wrapper around SQLite3. I suspect there could be a problem with the wrapper, but this problem only exists on a few tables. It makes me wonder if there is something wrong with the way those tables are setup. Any advice is appreciated.