Content Provider with multiple table

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Content Provider with multiple table

Postby sujitm » Tue Mar 04, 2008 10:01 am

Hi all,

Can anyone please provide a working database content provider example with multiple tables(using SQLite) and some join query? I am still unable to run my code. Pls help!
sujitm
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Mar 04, 2008 9:54 am

Top

Postby Peli » Wed Mar 05, 2008 4:17 pm

Hi,

We this several places in our OpenIntents project: http://code.google.com/p/openintents/

You may want to have a look at the shopping list example:
http://code.google.com/p/openintents/so ... vider.java

Hope it helps.

Peli
Peli
Junior Developer
Junior Developer
 
Posts: 17
Joined: Thu Dec 27, 2007 10:54 am

Postby plusminus » Wed Mar 05, 2008 5:12 pm

Hello Peli,

do you have code using explicitly a JOIN-Expression
Not these (I call it:) workaround-joins, like:
Syntax: [ Download ] [ Hide ]
Using sql Syntax Highlighting
  1. contains.item_id = items._id AND contains.list_id = lists._id
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Peli » Wed Mar 05, 2008 5:56 pm

plusminus wrote:do you have code using explicitly a JOIN-Expression
Not these (I call it:) workaround-joins, like:
Syntax: [ Download ] [ Hide ]
Using sql Syntax Highlighting
  1. contains.item_id = items._id AND contains.list_id = lists._id
Parsed in 0.002 seconds, using GeSHi 1.0.8.4



Through the projection map, only one big table is returned. So this works like an inner join, even though we did not explicitly use the JOIN expression. I wonder what would they do differently or what would the advantage of using them be?

Peli
Peli
Junior Developer
Junior Developer
 
Posts: 17
Joined: Thu Dec 27, 2007 10:54 am

Postby plusminus » Wed Mar 05, 2008 8:11 pm

Hello Peli,

I was not criticising your sql-statement :!:

Some weeks ago I had problems making a join, explicitly using the JOIN-keyword.
Maybe you find my error here: http://www.anddev.org/viewtopic.php?p=3710

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Peli » Thu Mar 06, 2008 8:46 am

plusminus wrote:Some weeks ago I had problems making a join, explicitly using the JOIN-keyword.
Maybe you find my error here: http://www.anddev.org/viewtopic.php?p=3710


:arrow: I answered you there.

Peli
Peli
Junior Developer
Junior Developer
 
Posts: 17
Joined: Thu Dec 27, 2007 10:54 am

Top

Return to General

Who is online

Users browsing this forum: No registered users and 6 guests