title: SQL query error or missing database shows syntax error using LIKE query
body: <p>I have a syntax error that I don't know how to solve. Here is the code:</p>
  
  <pre><code>fun allSearchData(searchStringRaw: String): Cursor{
      val searchString = "% $searchStringRaw %"
      val query = "Select * from $MARKER_TABLE where $KEY_NAME like $searchString"
      val c = mySpotsDatabase!!.rawQuery(query, null)
      c.moveToFirst()
      return c
  }
  </code></pre>
  
  <p>and it is giving me this error:</p>
  
  <pre><code> Error Code : 1 (SQLITE_ERROR)
  Caused By : SQL(query) error or missing database.
      (near "%": syntax error (code 1): , while compiling: Select * from my_locations_table where Name like % h %)
  </code></pre>
  
  <p>If I remove the spaces as follows it makes no difference.</p>
  
  <pre><code>val searchString = "%$searchStringRaw%"
  </code></pre>
  
  <p>and this just changes the error line to the following, so I know its not the space in the string issue.</p>
  
  <pre><code> (near "%": syntax error (code 1): , while compiling: Select * from my_locations_table where Name like %h%)
  </code></pre>
  
  <p>I can not see the syntax error.  Any help would be appreciated.</p>