using Query

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

using Query

Postby abdo19 » Thu Feb 11, 2010 10:46 pm

hi all,

I can't find the correct Query stracture to find all rows with the columns "type" and "region" have well defined values.

Can any one help me to express this SQL query using the Query method of a ContentProvider:

SELECT *
FROM Locations
WHERE ((region=Paris)AND(type="space"))


please help me .
abdo19
Freshman
Freshman
 
Posts: 7
Joined: Sun Oct 25, 2009 6:14 pm

Top

Postby mitutitu » Fri Feb 12, 2010 5:41 am

Hi abdo19,

for query in content provider you can follow this query structure:


Code: Select all
SELECT *
FROM Locations
WHERE ((region=Paris)AND(type="space"))


As your sql the query method will be as follows:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. query(CONTENT_URI, null,        "region='Paris' AND type='space'", null, null);
Parsed in 0.010 seconds, using GeSHi 1.0.8.4


hope it'll help you.

Thanks,
mitu
Android is awesome!
User avatar
mitutitu
Senior Developer
Senior Developer
 
Posts: 113
Joined: Tue Jun 09, 2009 7:40 am
Location: St. John's, NL, Canada

Postby abdo19 » Fri Feb 12, 2010 4:41 pm

Thanks very much mitu

It works very well.

Thanks.
abdo19
Freshman
Freshman
 
Posts: 7
Joined: Sun Oct 25, 2009 6:14 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: Exabot [Bot] and 3 guests