For one sql statement try:
update Contacts set
age = case id when 1 then 30
when 2 then 30
when 3 then 20
when 4 then 10 end
where id in (1,2,3,4);
David
--- On Tue, 5/6/08, cedric tuboeuf <[EMAIL PROTECTED]> wrote:
> From: cedric tuboeuf <[EMAIL PROTECTED]>
> Subject: [sqlite] multiple updates
> To: [email protected]
> Date: Tuesday, May 6, 2008, 4:26 PM
> Is there a way of doing that in one single shot :
> UPDATE Contacts SET Age = 30 WHERE ID = 1; UPDATE Contacts
> SET Age = 30
> WHERE ID = 2; UPDATE Contacts SET Age = 20 WHERE ID = 3;
> UPDATE Contacts SET
> Age = 10 WHERE ID = 4;
>
> I knwo I can process one a the time, but I would like to
> know why my query
> is not working if I build it and separate them with a
> semicolon....
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users