samedi 1 août 2015

In Android SQLite - create, if primary key does not exist, else update associated value

I have been trying to learn how I would implement the functionality mentioned in my title, but I can't seem to figure it out.

I have encountered mentions of "INSERT OR IGNORE", but have yet to see a working solution using that, or even finding a useful explanation of the inner working of it.

So I was hoping someone here could help me out frame an example of both how to achieve it, and most importantly why it works. I almost opted for a hard-coded solution to query and code accordingly to query again. But to keep the queries low and to better understand i am hoping to learn about solving the problem in the sqlite communication instead.

Aucun commentaire:

Enregistrer un commentaire