Thanks everybody, yea the problem is that the WHERE clause was using my string value without the quotes.
On Aug 13, 11:22 am, RichardC <richard.crit...@googlemail.com> wrote: > Try putting quotes around the phonenumber string > > On Aug 13, 4:15 pm, Wall-E <bashee...@gmail.com> wrote: > > > > > I have written a database adapter to implement database functions like > > query(), delete(), update(), insert()....etc. So I have been able to > > insert and query just fine but deleting a specific row is not working > > at all. I have tested deleting all the rows and that works fine even > > though the return value is still 0 or false. I have posted my > > delete() method and my table: > > > Again, I have confirmed insert and query but not delete and after > > sending this post I'm going to try the update to see if that works. > > Also, the open() call just does the DBHelper.getWritableDatabase(). > > I'm concerned that it is the way my table is set up but I've tried all > > the sql statements in a sqlite browser and that table is just fine. > > > db.execSQL( "CREATE TABLE " + ECHOLIST_TABLE + " (" + > > "[PHONENUMBER_ID] NVARCHAR(15) > > PRIMARY KEY NOT NULL, " + > > "[PHONENUMBER] NVARCHAR(15) NOT > > NULL);" ); > > > public boolean deletePhoneNumber(String phonenumber) > > { > > open(); > > db.beginTransaction(); > > > int rowsDeleted = db.delete(ECHOLIST_TABLE, PHONENUMBER_ID + > > "=" + phonenumber, null); > > > //int rowsDeleted = db.delete(ECHOLIST_TABLE, null, null); > > > db.setTransactionSuccessful(); > > db.endTransaction(); > > close(); > > > return (rowsDeleted > 0); > > } -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en