[Dbix-class] updating multiple records at once

Aaron Trevena aaron.trevena at gmail.com
Sun Jan 27 09:18:54 GMT 2008


On 27/01/2008, Jonathan Rockway <jon at jrock.us> wrote:
> "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.

What about slices of resultsets - can't I fetch my 100 objects then
put 30 in on resultset, 90 in another and 40 in yet another without
hitting the database 4 times instead of 3 ?

I did this in my subclass of CDBIs Iterator and it would be especially
handy in this situation.

A.

-- 
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Hosting



More information about the DBIx-Class mailing list