DBIx-ResultSet

 view release on metacpan or  search on metacpan

lib/DBIx/ResultSet.pm  view on Meta::CPAN

    );
    # Executes: UPDATE users SET phone = ?;

    $users_rs->search({ is_admin=>1 })->update({ phone=>'555-1234 });
    # Executes: UPDATE users SET phone = ? WHERE is_admin = ?;

Creates and executes an UPDATE statement.

=cut

sub update {
    my ($self, $fields) = @_;
    my ($sql, @bind) = $self->abstract->update( $self->table(), $fields, $self->where() );
    $self->_dbi_execute( 'do', $sql, \@bind );
    return;
}

=head2 delete

    # Delete all users!
    $users_rs->delete();

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.556 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )