-1

When i try to search in row POINTA (text data type in SQLite) and I compare it to a String the program stops. This is the code:

 public Cursor getpoints(String start,String end) throws SQLException {
   Cursor mCursor =  db.query(true, DATABASE_TABLE, new String[] {
                KEY_PRIM, 
                NAME,
                POINTA,
                POINTA_LANG,
                POINTA_LAT,
                POINTB,
                POINTB_LANG,
                POINTB_LAT
                },
                POINTA +"=" +start,//here is the problem 

                null,
                null, 
                null, 
                null, 
                null);
if (mCursor != null) {
    mCursor.moveToFirst();
}
...
1
  • Are you certain start is not null? Commented May 29, 2011 at 11:44

1 Answer 1

1

Same problem as this, you need single quotes around your start String, i.e.

     POINTA + "='" + start + "'",
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.