[android-developers] Re: select query problem.

2010-11-11 Thread pramod.deore
Thanks Guys, Using rawQuery()it works. On Nov 11, 11:25 pm, Kumar Bibek wrote: > It's not mandatory to use the primary key. > > On Thu, Nov 11, 2010 at 4:29 PM, Ravi Shankar Kumar > wrote: > > > > > plz use primary key that is generally autoincreamented key for any > > particular row identificat

Re: [android-developers] Re: select query problem.

2010-11-11 Thread Kumar Bibek
It's not mandatory to use the primary key. On Thu, Nov 11, 2010 at 4:29 PM, Ravi Shankar Kumar wrote: > plz use primary key that is generally autoincreamented key for any > particular row identification > > > On Thu, Nov 11, 2010 at 4:15 PM, pramod.deore wrote: > >> Logcat gives me following outp

Re: [android-developers] Re: select query problem.

2010-11-11 Thread Ravi Shankar Kumar
plz use primary key that is generally autoincreamented key for any particular row identification On Thu, Nov 11, 2010 at 4:15 PM, pramod.deore wrote: > Logcat gives me following output > > 11-11 16:13:13.031: ERROR/Database(709): Failure 1 (no such column: > BathRoom) on 0x145618 when preparing '

[android-developers] Re: select query problem.

2010-11-11 Thread moffetta
you should pass bathroom with apices, so 'bathroom' not bathroom. with apices sql knows you are talking about a value not a column name. String APICE = "'"; //the value is ' sampleDB.execSQL("SELECT RoomID FROM " +ROOM_TABLE_NAME+"where RoomName="+ APICE + selectedRoom + APICE); hope i understo

Re: [android-developers] Re: select query problem.

2010-11-11 Thread Filip Havlicek
Indeed, you can use execSQL for statements like CREATE, UPDATE, DELETE, INSERT. For SELECT you have to use query. Best regards, Filip Havlicek 2010/11/11 Daniel Drozdzewski > On Thu, Nov 11, 2010 at 11:17 AM, pramod.deore > wrote: > > Hi, Daniel and Filip Thanks for reply. > > after changing q

Re: [android-developers] Re: select query problem.

2010-11-11 Thread Daniel Drozdzewski
On Thu, Nov 11, 2010 at 11:17 AM, pramod.deore wrote: > Hi, Daniel and Filip Thanks for reply. > after changing query as > sampleDB.execSQL("SELECT RoomID FROM " +ROOM_TABLE_NAME+" where > RoomName='"+selectedRoom + "'"); > > Now logcat gives following warning > > 11-11 16:44:42.298: WARN/System.e

[android-developers] Re: select query problem.

2010-11-11 Thread pramod.deore
Hi, Daniel and Filip Thanks for reply. after changing query as sampleDB.execSQL("SELECT RoomID FROM " +ROOM_TABLE_NAME+" where RoomName='"+selectedRoom + "'"); Now logcat gives following warning 11-11 16:44:42.298: WARN/System.err(772): android.database.sqlite.SQLiteException: unknown error: Quer

Re: [android-developers] Re: select query problem.

2010-11-11 Thread Filip Havlicek
Hi Pramod, since you are trying to select something based on a string where clause, you have to encapsulate the string into '', so you have to write either selectedRoom='BathRoom' or sampleDB.execSQL("SELECT RoomID FROM " +ROOM_TABLE_NAME+"where RoomName='"+selectedRoom+"'"); (= put the quotes in

[android-developers] Re: select query problem.

2010-11-11 Thread pramod.deore
Logcat gives me following output 11-11 16:13:13.031: ERROR/Database(709): Failure 1 (no such column: BathRoom) on 0x145618 when preparing 'SELECT RoomID FROM roomtable where RoomName=BathRoom'. 11-11 16:13:13.159: WARN/System.err(709): android.database.sqlite.SQLiteException: no such column: BathR