Fey::SQL::Update - Represents a UPDATE query
my $sql = Fey::SQL->new_update(); # UPDATE Part # SET quantity = 10 # WHERE part_id IN (1, 5) $sql->update($Part); $sql->set( $quantity, 10 ); $sql->where( $part_id, 'IN', 1, 5 ); print $sql->sql($dbh);
This class represents a UPDATE query.
UPDATE
This class provides the following methods:
To construct an object of this class, call $query->update() on a Fey::SQL object.
$query->update()
Fey::SQL
This method specifies the UPDATE clause of the query. It expects one or more Fey::Table objects (not aliases). Most RDBMS implementations only allow for a single table here, but some (like MySQL) do allow for multi-table updates.
This method takes a list of key/value pairs. The keys should be column objects, and the value can be one of the following:
a plain scalar, including undef
This will be passed to Fey::Literal->new_from_scalar().
Fey::Literal->new_from_scalar()
Fey::Literal object
Fey::Literal
Fey::Column object
Fey::Column
A column alias cannot be used.
Fey::Placeholder object
Fey::Placeholder
See the Fey::SQL section on WHERE Clauses for more details.
See the Fey::SQL section on ORDER BY Clauses for more details.
See the Fey::SQL section on LIMIT Clauses for more details.
Returns the full SQL statement which this object represents. A DBI handle must be passed so that identifiers can be properly quoted.
See the Fey::SQL section on Bind Parameters for more details.
Returns the UPDATE clause portion of the SQL statement as a string.
Returns the SET clause portion of the SQL statement as a string.
SET
Returns the WHERE clause portion of the SQL statement as a string.
WHERE
Returns the ORDER BY clause portion of the SQL statement as a string.
ORDER BY
Returns the LIMIT clause portion of the SQL statement as a string.
LIMIT
This class does Fey::Role::SQL::HasBindParams, Fey::Role::SQL::HasWhereClause, Fey::Role::SQL::HasOrderByClause, and Fey::Role::SQL::HasLimitClause roles.
Fey::Role::SQL::HasBindParams
Fey::Role::SQL::HasWhereClause
Fey::Role::SQL::HasOrderByClause
Fey::Role::SQL::HasLimitClause
Dave Rolsky, <autarch@urth.org>
See Fey for details on how to report bugs.
Copyright 2006-2009 Dave Rolsky, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Fey, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Fey
CPAN shell
perl -MCPAN -e shell install Fey
For more information on module installation, please visit the detailed CPAN module installation guide.