On 5/6/08, cedric tuboeuf <[EMAIL PROTECTED]> wrote:
> 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....

If there was some logical connection between your value and
constraint, you could use that to build a set and update it. For
example, if you the age of your contact was 3 times their ID, you
could do

UPDATE contacts
SET age = ID * 3
WHERE ID IN (1, 2, 3, 4)

As you have listed above, your query is not one valid query, but many
queries trying to pose as one. As far as I know, a semi colon is not a
valid SQL character, keyword or operator.

Look in the SQLite expressions documentation. You might be able to use
something there, but I doubt it.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to