Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Contributor
Posts: 43
Registered: ‎07-22-2012
My Device: curve
My Carrier: syudent
Accepted Solution

What's wrong in this sqlite statement

st1 = db.createStatement("select[" + KEY_ITEM_ID+ "]From [" + DATABASE_TABLE_FavItems + "] Where ["+ KEY_FAVORITE_ID + "] <> " + fId + "AND ["+ KEY_ITEM_ID + "]" + "=" + fId);

 please anybody help me

Developer
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: What's wrong in this sqlite statement

Hi @ahmednaserfinal

 

Try without the square brackets:

 

st1 = db.createStatement("select " + KEY_ITEM_ID+ " From " + DATABASE_TABLE_FavItems + " Where "+ KEY_FAVORITE_ID + " <> " + fId + "AND "+ KEY_ITEM_ID + "=" + fId);

Hope that helps,

 

E.

Contributor
Posts: 32
Registered: ‎08-13-2012
My Device: 9800
My Carrier: Rogers

Re: What's wrong in this sqlite statement

It looks like you didn't include a space before the "AND":

 

 fId + "AND..."