I don’t understand what is causing the syntax error. The same query runs succefully if placed on MySQL Workbench with the “?” replaced by appropriate values.
Also, since I want sqm to have the same value everywhere, is it ok to replace all parameters “sqm 1 - 4” with just “sqm” so that it is less time consuming to setup this parameter when calling this API?
It’s pretty tough for forum users to debug these long strings of textual information. One guess would be to try and put parentheses around your ?-1 and ?+1 statements, but that’s just a guess.
Here’s what I do to solve things like this…
Start a new SQL Query
Build it piece by piece and parameter by parameter, using the test values as you go
Isolate the problem statement/parameter
Create a new SQL Query just with that type of statement/parameter. Get it to work in it’s most simple state.
Then you will know how to fix your original query.
Hope that helps. If you figure it out, please post the answer so others can benefit.
Lastly, the answer to your question about replicating parameters. The answer is no - you have to have exactly the same number of parameters as question marks. That’s just how it works. I agree, it’s lame to have to re enter the same value over and over. I have to do that many times in my app too :<