jatill has asked for the wisdom of the Perl Monks concerning the following question:

How would I delete all rows in a table using Class::DBI? I though Table->delete_all() might work, but no such luck. Thanks. ~jeff

Replies are listed 'Best First'.
Re: Class::DBI deletes
by Corion (Patriarch) on Jul 21, 2005 at 13:57 UTC

    Did you read the documentation ?

    Multiple objects can be deleted by calling delete_all on the Iterator returned from a search.
    Table->retrieve_all->delete;
      Indeed I looked at the docs, but you don't always see everything. Thanks.
Re: Class::DBI deletes
by socketdave (Curate) on Jul 21, 2005 at 14:00 UTC
    I've not used this module, but it looks like this would do the trick: $obj->search(field => '%')->delete_all

    http://search.cpan.org/~tmtm/Class-DBI-0.96/lib/Class/DBI.pm#delete