Go Back   Android Forums > Android Development > Application Development
Application Development Dev Lounge for the Coder Folks
Gamers - Check out our new sister sites!
Nintendo Wii U!    |    OUYA - $99 Android System!

test: Reply
 
LinkBack Thread Tools
Old November 29th, 2012, 07:25 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jul 2012
Posts: 7
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default How to delete from SQLite

Hi every one
i want to run a delete query with limitation .
I've tried to many queries but they didn't work .
For know , I just want to remove all the rows and I write this code "

DELETE FROM tbl1 where _id IN(select _id from tbl1 WHERE cat=21)

The emulator runs perfectly without any error .
right now , I have 32 rows with cat = 21 .

could you help me to solve this problem ?

Thanks

hno2005 is offline  
Reply With Quote
Sponsors
Old November 29th, 2012, 10:52 AM   #2 (permalink)
Member
 
Join Date: Dec 2010
Location: Colorado (USA)
Posts: 104
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 11 Times in 11 Posts
Default

Isn't that the same as:

DELETE FROM tbl1 WHERE cat=21
mills2533 is offline  
Reply With Quote
Old November 29th, 2012, 05:32 PM   #3 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,925
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 462 Times in 285 Posts
Default

Quote:
Originally Posted by mills2533 View Post
Isn't that the same as:

DELETE FROM tbl1 WHERE cat=21
Yes, this query is the same and also much cleaner than the OP's query.

As for why it is not working on the device, but does on the emulator, it's hard to tell with the given information. Do you receive an exception? An SQL Error code? Both?
__________________
My blog, Inverted Keystrokes, is looking for aspiring developers (not necessarily with Android) to post articles. If you have any development experience and are interested in participating, please PM me. =)
jonbonazza is online now  
Reply With Quote
Old April 18th, 2013, 10:10 AM   #4 (permalink)
New Member
 
Join Date: Apr 2013
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 1 Time in 1 Post
Default

can I get the full codes?
junchronick is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:08 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.