Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Android Data Persistence CRUD Operations with SQLite Deleting Data

Zubeyr Aciksari
Zubeyr Aciksari
21,074 Points

HOORAY! Rover has been found! We can now delete this entry from our database. As usual, assume you already have a variab

Please little help here, i am confused! Thanks!

CodeChallenge.java
String clause = String.format("%s=%s", "name", "Rover");
database.delete(MemeSQLiteHelper.PETS_TABLE);


/* Add your code here! 
 * Assume you already have a variable named 'database'.
 */

3 Answers

George Pirchalaishvili
George Pirchalaishvili
3,747 Points

Try this code

database.delete ("PETS_TABLE", clause, null);
Zubeyr Aciksari
Zubeyr Aciksari
21,074 Points

Thanks a lot Gearge, it worked!

Zubeyr Aciksari
Zubeyr Aciksari
21,074 Points

i am sorry for the misspelling, didn't mean it George.. Thanks anyways!