3

I have a question string variable that contains the word "Where is my car?"

when I try and run a select on this it crashes.

String sql = "Select * from tblHALv2001 WHERE tblHALv2001 MATCH '" + question + "'";

fts5: syntax error near "?"

If I remove the question mark from the question variable then it works. But how can I correct the statement so it doesn't crash?

CL.
  • 173,858
  • 17
  • 217
  • 259
maximdj
  • 315
  • 1
  • 12

1 Answers1

2

You cannot simply use any random string with FTS; MATCH expects an FTS query as its right operand.

You could use double quotes to escape the question mark, but then the tokenizer would ignore it anyway.

CL.
  • 173,858
  • 17
  • 217
  • 259