0

I'm hitting a wall in an android SQL query, this is what I have so far:

        mDb.query(false, DATABASE_TABLE, new String[] {KEY_ROWID, KEY_ROWONE, KEY_ROWTWO, KEY_ROWTHREE, KEY_ROWFOUR, KEY_ROWFIVE}, KEY_ROWONE +" LIKE '?%'", new String[] { letter }, null, null, null, null);

Basically, I want the query to return all the rows in the table where KEY_ROWONE starts with the variable letter (a string containing one letter).

I get a force close when I'm running the code, and I'm really puzzled.

I promise to tick the best answer!

2 Answers 2

1

It's alright guys, panic over, I found the solution:

mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, KEY_ROWONE, KEY_ROWTWO, KEY_ROWTHREE, KEY_ROWFOUR, KEY_ROWFIVE}, KEY_ROWONE+" LIKE ? || '%'", new String[] { l }, null, null, null, null);
Sign up to request clarification or add additional context in comments.

Comments

0

Just in case someone will be interested, here's full database tutorial for android: http://knightswhocode.com/wordpress/?p=14

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.