Hi,

It's a Content Provider that use SQLite Database.

I want pass data of one table to another with  Insert-Select sintax
and/or check that data not exist in second table.

I Found that SQLite permit sintax:

Insert into Table(t1, t2)
Select tx, ty
>From Table      --To insert select from one table to another

OR

Insert into Table(t1, t2)
Select tx, ty  WHERE NOT EXISTS ... --To Check if data exist or not

I thought that through the Content Provider could emulate this syntax

thanks.


On 20 ene, 12:59, "A. Elk" <lancaster.dambust...@gmail.com> wrote:
> Are you talking about a content provider or an SQLite database? They aren't
> equivalent. A content provider *may* use an SQLite database as its database
> repository, but it doesn't have to, and you can't assume that it does.
>
> *If it's a content provider:*
>
> You can do an insert followed by a query. Generally, it has to be done in
> two separate method calls:
>
> ContentResolver.insert();
> ContentResolver.query();
>
> One row can be inserted per insert().
>
> You can also do a "transaction" using ContentProviderOperation objects and
> then ContentResolver.applyBatch();
>
> *If it's an SQLite database:*
>
> You can do anything you can do in SQLite itself, using the classes in
> android.database.SQLite. Remember, though, that in general you *can't* use
> SQLite classes against a content provider (in general).
>
> *In addition:*
> *
> *
> If this doesn't answer your question, you might try to explain your use
> case rather than simply asking if SQLite operations translate to Android.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to