Retrieving a set of rows from the sqlite database

7 views
Skip to first unread message

Siddharth Verma

unread,
Apr 24, 2011, 1:30:57 PM4/24/11
to bpgc-androi...@googlegroups.com
I want to do:

SELECT * FROM <TableName> WHERE <attribute(id)> IN <ArrayList type>

but theres an error
04-24 21:18:41.748: ERROR/Error(29495): android.database.sqlite.SQLiteException: no such table: 1: , while compiling: SELECT * FROM Main WHERE id IN [1]

basically i want to select those rows with Attribute(id) which are present in an ArrayList...
but the format of the ArrayList is not the same as the one reqd for this type of query(i guess)
and i think this is the reason, its not workin correctly

Thanks in advance :)

Sagar Jauhari

unread,
Apr 24, 2011, 1:44:56 PM4/24/11
to bpgc-androi...@googlegroups.com
It means that the database is there but its an empty database.  you need to follow this: http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
--

Sagar Jauhari
Sr. Undergraduate, Computer Science
BITS Pilani, Goa Campus
+91-8087664571
sagarj...@gmail.com


Siddharth Verma

unread,
Apr 24, 2011, 1:49:23 PM4/24/11
to bpgc-androi...@googlegroups.com
no not at all
its filled and if i query it with:
SELECT * FROM <TableName> WHERE <attribute(id)> IN <Integer>
it shows me the correct result... but obv it only selects that particular id's row...

note: ArrayList is replaced with Integer... (which is the data-type of my attribute(id))

Also,
the tool they have used in the website, do u know how to use that... as in have u used it?

Sagar Jauhari

unread,
Apr 25, 2011, 11:05:57 AM4/25/11
to bpgc-androi...@googlegroups.com
SQLite data browser? Its is a very common tool. Its a plugin for Firefox. 
Reply all
Reply to author
Forward
0 new messages