[Dbix-class] chained 'search' then 'update'

Angel Kolev ankolev at gmail.com
Wed Mar 5 07:25:54 GMT 2008


Hi, all.

I have a table with fields 'id' and 'status'. Status is ENUM field with 
values 'active' and 'backup'. I need somethink like(i use dbic in catalyst):

my $rs = $c->model('ModelDB::CheckMap')->search({id => 
$id})->update('status','backup');
$rs->create({%params});

I have to change the status of all old fields for id $id to 'backup' 
then create new fields. Can i change this status in one pass like 
example above?

Thanks




More information about the DBIx-Class mailing list