[Dbix-class] Update first X rows
Yves Räber
yraber at mailup.net
Tue Jul 14 07:52:12 GMT 2009
Hello,
I need to update the first X rows of a resultset, and I've tried something like this :
my $to_dispatch = $c->model('myDB::Table')->search($sql_args, { rows => 10 });
$to_dispatch->update( { state => 'TODO' } );
It works, but generate a query for each row.
What I would like to generate is a query that looks like "UPDATE Table SET state = 'TODO' WHERE blablabla LIMIT 10".
It it possible to do this with DBIx::Class ?
Thanks.
Yves.
More information about the DBIx-Class
mailing list