views:

51

answers:

2

I have a query that pulls everything from a database into a list view.

return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_HEIGHT, KEY_BODY, KEY_HOMEID},null , null, null, null, null,null);

                                |               String Having is the 3rd from
                                                           last null.

I want only the records where the field KEY_HOMEID matches a variable called journalId which should be a numeric string.

I would also like to know how to bring the variable into my DatabaseAdapter... would ((resource) this.getApplication()).getjournalId()) work?? resource is a class that extends application.

A: 

Use a WHERE clause; HAVING is only used with GROUP BY.

Doug Currie
wouldSELECT * FROM DATABASE_TABLE WHERE KEY_HOMEID=((resource) this.getApplication()).getjournalId());work? where should i put it in relation to the query?
Brian
public Cursor fetchAllNotes(String journalId) {return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_HEIGHT, KEY_BODY, KEY_HOMEID},"FROM DATABASE_TABLE WHERE KEY_HOMEID = journalId",null, null, null, null,null);thats where i'm at right now still no dice
Brian
+1  A: 
Christopher