When developing apps by using SQLite as a storage backend, you most likely will sometime get the error message:
The message very clearly describes what happened: you have prepared an SQL statement like "SELECT ... WHERE id=? OR id=? OR id=?" or at least something like that, and the placeholders (in this case the question marks) are too many.
It is quite annoying SQLite has limitations like this, because there is hardly any documentation for it. So I did my Google search and found out there is a limit of 999 variables per SQL query.
The solution for me was very simple and straight forward:
The referenced variables (im my case the "id" values) are fetched from the database in a usual "SELECT id FROM table WHERE age<:maxAge". I just limitted the result set to 999 (by appending a "LIMIT 999" clause) and the error was solved.
PS: I accidently just found the docs about this topic. It is titled "Maximum Number Of Host Parameters In A Single SQL Statement" ...so the variables referenced by the error message are also called "host parameters" and the default to 999. See Run-Time Limit Categories and the SQLITE_LIMIT_VARIABLE_NUMBER setting for further information.