Sqlite Delete doesn't delete

by Wall-E » Fri, 13 Aug 2010 23:16:00 GMT


Sponsored Links
 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);
    }

--



Sqlite Delete doesn't delete

by Chris Stewart » Fri, 13 Aug 2010 23:20:03 GMT


 I use db.execSQL to delete.

--
Chris Stewart
 http://chriswstewart.com 

Fantasy 
Football< http://chriswstewart.com/android-applications/fantasy-football/> ;-
Android app for fantasy football fanatics and MFL owners
Social Updater< http://chriswstewart.com/android-applications/social-updater/> ;-
An easy way to send your status blast to multiple social networks






>


Sponsored Links


Sqlite Delete doesn't delete

by Farjad Habib » Fri, 13 Aug 2010 23:20:32 GMT


 give the phonenumber in single quotes....like below

PHONENUMBER_ID + "='" + phonenumber +"'"



>



Sqlite Delete doesn't delete

by RichardC » Fri, 13 Aug 2010 23:22:44 GMT


 Try putting quotes around the phonenumber string




--



Sqlite Delete doesn't delete

by Wall-E » Sat, 14 Aug 2010 00:08:23 GMT


 Thanks everybody, yea the problem is that the WHERE clause was using
my string value without the quotes.





--



Other Threads

1. Android market clearly has to be full of piracy...oh well what can you do

So I have two apps, Electrum Drum Machine and ReLoop Loop Sequencer.

The drum machine actually still sells really well. It's probably
reached some sort of threshold to stay up in sales.

However, my newest app, ReLoop, has only had about 17 total downloads
over the entire weekend. AND what's interesting is I made two sample
packs for it, and one of those has 54 downloads, and the other has 116
downloads.

Now, there isn't any reason for someone to download a sample pack more
than once, so it really looks suspicious when I only have 17 downloads
of the core app and over 160 downloads of the sample packs. In fact it
makes me think someone ripped my app right away and its on a forum
somewhere (though I cant find it yet)

Well this really stinks, I know it can take some time for apps to
slowly climb in sales, but honestly if this is what most devs
encounter than no wonder we dont have quality apps in Android. I
worked on this app for over 8 months and it's way better in sound
quality and speed than my drum machine app, and more accurate as well.
I dont think its the popularity of the app functionality, I think it's
loose on some website somewhere - hence my strange download numbers...

This. Is. Crap.

-niko

-- 

2. getting R.String Value using different class

Im not quite sure of what it is that im doing wrong, but im sure its a
simple mistake.

essentially im having a problem with the following

String Hello;
Hello = getString(R.string.Hello);


R.String.Hello does have a value if i look at it in my expressions
window but if i use the getString Function, i end up with "An
exception occurred: java.lang.NullPointerException"

I have to assume its because im trying to access this value from a
completely different class, because in the base class that im using,
getString works fine..

-- 

3. Spurious calls to onPause?

4. Emulator (AVD) voice recording

5. shouldOverrideUrlLoading not getting called for file:///android_asset links

6. Can not create service interface

7. drawable-hdpi not appearing in eclipse emulator