[Dbix-class] Using update on a resultset with join

Matt S Trout mst at shadowcat.co.uk
Thu May 6 20:35:31 GMT 2010


On Wed, May 05, 2010 at 12:24:18PM +0200, Peter Rabbitson wrote:
> > Whereas I was expecting SQL like:
> > UPDATE foo me JOIN ( bars bar ON bars.id = me.bar_id ) SET me.exported =
> > 1 WHERE ( me.exported = 0 AND bar.state = 'WA' )
> > 
> 
> Newer versions address this issue, albeit not with the SQL you proposed
> (I am not aware of any RDBMS which will execute the above sanely - i.e.
> *really* restrict the update-able set with the join). In any case -
> simply upgrade.

It's called PostgreSQL. Here's a dollar, MySQL boy, get yourself a real
database.

(though that's still completely the wrong syntax - see

http://www.postgresql.org/docs/current/static/sql-update.html

for the actual SQL involved)

-- 
Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue

http://shadowcat.co.uk/blog/matt-s-trout/   http://twitter.com/shadowcat_mst/

Email me now on mst (at) shadowcat.co.uk and let's chat about how our Catalyst
commercial support, training and consultancy packages could help your team.



More information about the DBIx-Class mailing list