[Dbix-class] updating multiple records at once

Jonathan Rockway jon at jrock.us
Sun Jan 27 02:31:22 GMT 2008


"Aaron Trevena" <aaron.trevena at gmail.com> writes:

> On 25/01/2008, Jonathan Rockway <jon at jrock.us> wrote:
> Can you do that with subsets of a result set - i.e. I have a resultset
> of a page of records, 20 need to have the "fantastic" flag set, 100
> need to have the state set from "pending" to approved.

Well, one resultset should contain the records that need to be
"fantastic", and another should contain the records that need to be
approved.  Then you update them as appropriate.

If this is a frequent operation, write a method in your ResultSet
class to do it.  Actually, you should do that anyway :)

Regards,
Jonathan Rockway



More information about the DBIx-Class mailing list