If the following can be considered as one step then do it like this:
BEGIN;
UPDATE LSOpenSubProjects
SET price = (SELECT sum(price) FROM table1 WHERE subProjID = 24),
udate = now
WHERE subProjID = 24;
UPDATE LSOpenProjects
SET price = (SELECT sum(price) FROM table2 WHERE ProjID = 8),
udate = now
WHERE ProjID = 8;
END;
Pavel
On Wed, Jul 21, 2010 at 2:28 PM, jose isaias cabrera
<[email protected]> wrote:
>
> Greetings and salutations.
>
> I believe this is possible, but I can not seem to get the syntax from the
> site. I have these 3 commands and 3 different steps that I want to put into
> one:
>
> 1. result1 = SELECT sum(price) FROM table1 WHERE subProjID = 24;
> 2. result2 = SELECT sum(price) FROM table2 WHERE ProjID = 8;
> 3. BEGIN;
> UPDATE LSOpenSubProjects SET price = result1 WHERE subProjID = 24;
> UPDATE LSOpenSubProjects SET udate = now WHERE subProjID = 24;
> UPDATE LSOpenProjects SET price = result2 WHERE ProjID = 8;
> UPDATE LSOpenProjects SET udate = now WHERE ProjID = 8;
> END;
>
> How can I put all of these 3 steps into one?
>
> thanks,
>
> josé
>
> _______________________________________________
> 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