[CDBI] result from 'search_where' to 'update'
Cyril Cheneson <[email protected]> Tue, 14 Apr 2009 11:17:01 +0200
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
Hi everybody
I m querying a Mysql db via the 'search_where' method which returns an iterator.
But when I m trying to update a field for each record found, this
doesnt seem to work
##############################
Id is a array ref and $userid a scalar
my $msgs = Messages->search_where(
id => $messageIds, user_id => $userid
);
while (my $msg = $msgs->next) {
$msg->$col($value);
$msg->update;
}
##############################
Has anyone seen this problem/behaviour before?
I also tried
$msg->set($col => $value);
but without any success either.
so I m not sure if the
$msg->$col($value)
is evaluated properly (I also tried to eval this , same result)
Thanks a lot
Cyril