3 messages in com.googlegroups.android-developersRe: Get a set of contacts
FromSent OnAttachments
Praline17 Mar 2008 01:06 
Praline17 Mar 2008 05:33 
Praline30 Mar 2008 16:22 
Subject:Re: Get a set of contacts
From:Praline (pasc@gmail.com)
Date:03/30/2008 04:22:13 PM
List:com.googlegroups.android-developers

Hi all,

The problem come from the construction of the sql query retrieving people, there is a ambiguity on column name: _id. I solve the problem using "people." + People._ID. It's a _dirty_ solution but can't get the table name in a class property (or don't know how ;)).

The query used by the SDK to get people is : SELECT COUNT(*) FROM (SELECT people._id AS _id, name, number, ... FROM people LEFT OUTER JOIN phones ON people.preferred_phone=phones._id LEFT OUTER JOIN presence ON (presence.person=people._id) WHERE "what you want but if a condition is on '_id' sqlite3 will don't know if you talk about 'people._id' or 'presence._id'"

The use of a view to retrieve peoples in the content provider should probably solve this ambiguity problem. What do you think about this ?

Thanks all.

Sorry, sql code used isn't "IN {...}" but "IN (...)".

So this code return null instead of a cursor : getContentResolver().query(People.CONTENT_URI, null, People._ID + " IN (3,4,5)", null, null);

Best Regards, Praline

On 17 mar, 09:07, Praline <pasc@gmail.com> wrote:

Hello all,

I try to get a set of contacts with this code and it doesn't works: getContentResolver().query(People.CONTENT_URI, null, People._ID + " IN {3,4,5}", null, null);

Anybody has an idea?

Best Regards,