in reply to Parsing text-based queries to SQL queries
In theory, you'd know the names of all of the fields in your expressions, and what are valid operators, so you could just try to assume that runs of items between them are values that require placeholders.
If you're just dealing with numbers, as in the example, it should be easy. Text is more difficult, as someone may search for something with the word 'like' or 'and' in it, throwing you off.
Now -- I said 'in theory'. I've never tried implementing something like this (although I may in the near future), so there may be some subtle problems that I haven't thought of.
|
|---|