SQL::Abstract::Query::Delete - An object that represents a SQL DELETE.
use SQL::Abstract::Query; my $query = SQL::Abstract::Query->new( $dbh ); # Delete all records from the rental table: my ($sql) = $query->delete( 'rental' ); $dbh->do( $sql ); # Delete all inventory for a particular film: my ($sql, @bind_values) = $query->delete( 'inventory', {film_id => $film_id} ); $dbh->do( $sql, undef, @bind_values ); # Use the OO interface to re-use the query and delete all staff in # several stores: my $delete = $query->delete( 'staff', {store_id => 'id'} ); my $sth = $dbh->prepare( $delete->sql() ); $sth->execute( $delete->values({ id => $store1_id }); $sth->execute( $delete->values({ id => $store2_id });
The delete query is a very lightweight wrapper around SQL::Abstract's delete() method and provides no additional SQL syntax.
Instances of this class should be created using "delete" in SQL::Abstract::Query.
This class applies the SQL::Abstract::Query::Statement role.
See "Table" in SQL::Abstract::Query::Statement.
Optional. See "Where" in SQL::Abstract::Query::Statement.
Aran Clary Deltac <bluefeet@gmail.com>
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install SQL::Abstract::Query, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SQL::Abstract::Query
CPAN shell
perl -MCPAN -e shell install SQL::Abstract::Query
For more information on module installation, please visit the detailed CPAN module installation guide.