db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Walt Armour <Wa...@concur.com>
Subject UPDATE and criteria across multiple tables
Date Tue, 11 Mar 2003 19:52:51 GMT
I'm looking at implementing a patch for the hugely inefficient way Torque
does updates and deletes (this has been discussed previously on the list and
a patch against an older Torque was posted by cfelaco@netscape.net).

I've found something that I consider highly odd in the code and was hoping
someone could tell me the reasoning behind it (otherwise it's getting

In BasePeer.doUpdate() it builds up a list of tables and loops, performing a
select/update cycle for each table mentioned in the select criteria (not the
update values criteria).  Looking at the way the code is implemented it
appears that if anyone actually used this functionality they could really
hurt themselves.

A SQL update can only affect one table.  However, the where clause can
reference multiple tables but there still would only be a single table

So, boils down to this: why is this functionality in there?  I can't think
of any valid way to use it from a criteria standpoint nor can I think of a
valid SQL equivalent that would yield updates to multiple tables with a
single statement.

View raw message