SQL::Abstract::Query::Insert - An object that represents a SQL INSERT.
use SQL::Abstract::Query; my $query = SQL::Abstract::Query->new( $dbh ); # Insert a new country: my ($sql, @bind_values) = $query->insert( 'country', { country=>$name } ); $dbh->do( $sql, undef, @bind_values ); # Use the OO interface to re-use the query and insert multiple countries: my $insert = $query->insert( 'country', ['country'] ); my $sth = $dbh->prepare( $insert->sql() ); $sth->execute( $insert->values({ country => $country1_name }); $sth->execute( $insert->values({ country => $country2_name });
The insert query is a very lightweight wrapper around SQL::Abstract's insert() method and provides no additional SQL syntax.
Instances of this class should be created using "insert" in SQL::Abstract::Query.
This class applies the SQL::Abstract::Query::Statement role.
See "Table" in SQL::Abstract::Query::Statement.
See "FieldValues" 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.