[android-developers] Re: SQLite problems: how to use LIKE expression

2008-10-18 Thread Anm
>From the SQLite3 docs: The LIKE operator does a pattern matching comparison. The operand to the right contains the pattern, the left hand operand contains the string to match against the pattern. A percent symbol % in the pattern matches any sequence of zero or more characters in the string. An u

[android-developers] Re: SQLite problems: how to use LIKE expression

2008-10-18 Thread jtaylor
Snippet from WikiNotesProvider.java: case KEYWORD_SEARCH: // this match searches for a text match in the body of notes qb.setTables("keywords"); qb.setProjectionMap(KEYWORDS_LIST_PROJECTION_MAP); qb.appendWhere("body like ? or title like ?")

[android-developers] Re: SQLite problems: how to use LIKE expression

2008-10-17 Thread Mark Murphy
Premier wrote: > The problem is '%?%' . > It doesn't recognize that string. If you are expecting ? to be a wildcard (e.g., single character), that's not the SQLite syntax. http://www.sqlite.org/lang_expr.html -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to And

[android-developers] Re: SQLite problems: how to use LIKE expression

2008-10-17 Thread Premier
The problem is '%?%' . It doesn't recognize that string. On 17 Ott, 12:48, Mark Murphy <[EMAIL PROTECTED]> wrote: > Premier wrote: > > Hello world, > > like in object, i want to use LIKE expression in Android > > > [CODE] > > private SQLiteDatabase db; > > ... > > Cursor resultCursor= null; > > r

[android-developers] Re: SQLite problems: how to use LIKE expression

2008-10-17 Thread Mark Murphy
Premier wrote: > Hello world, > like in object, i want to use LIKE expression in Android > > [CODE] > private SQLiteDatabase db; > ... > Cursor resultCursor= null; > resultCursor= db.query(false, DB_TABLE, null, "id like %"+id+"%", > null, null, null, null, null); > ... > [/CODE] I have not trie