forum

Home / DeveloperSection / Forums / Using the WHERE clause in SQLite

Using the WHERE clause in SQLite

Anonymous User350529-May-2013
Hi Expert!

I have a general question about using WHERE clauses in SQLite. I have worked with SQLite some and know my way around. However, I'm having trouble with WHERE clauses.

I have an Android application in which I'm needing to do a few simple operations with the SQLite WHERE clause. However, despite experimenting with the WHERE clause 

all day, I've come up empty. I am trying to perform very simple SQLite commands (e.g. SELECT name FROM tablename WHERE _id=2 or DELETE FROM tablename WHERE 

name='somename'). But, every time I use the where clause I either get 0 rows returned (in the case of a SELECT) or have 0 rows deleted.

The table name is correct. The column names are correct. (I haven't had any trouble selecting or inserting as long as I don't specify a WHERE clause.) I made sure 

that the queries/statements were well formed. I've tried both raw queries/statements as well as the methods (I made sure to use the correct methods for SELECT and 

DELETE {e.g. rawQuery() or query() for SELECT}) provided from the SQLiteDatabase class in Android, but nothing has worked.

All I need is to be able to perform simple queries/statements using the WHERE clause. Does anyone have any insight as to what's happening?

Thanks in advance! 

Updated on 30-May-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By