Jean-Christophe Deschamps wrote:
> 
> Do you have a short example where "INSERT OR REPLACE INTO ..." can be 
> shown to actually _delete_ rows?
> Which query are you refering to?

sorry, i meant "columns" not rows, whet i do insert command, specifying
existing id and only some of the columns then the rest of the columns are
deleted
on the other hand, UPDATE command won't allow me to insert a new row



>From what I understand, you might be happy with making your Id column 
> Integer Primary Key (also look at autoincrement feature) then do a 
> standard insert or replace.

i have it precisely like that


Also if SQLite is passed a null Id then it will generate the "next" 
> available rowid for you. But then it's no more a one-liner since your 
> application need to know which Id the newly inserted row has been 
> given, typically with a query like Select 

there should be a possibility to check id of the last affected row and
return it to the code
-- 
View this message in context: 
http://www.nabble.com/one-liner-for-insert-or-update---tp25416164p25432143.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to