Dave Rolsky > Fey > Fey::SQL::Delete

Download:
Fey-0.40.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  3
Open  2
View/Report Bugs
Module Version: 0.40   Source  

NAME ^

Fey::SQL::Delete - Represents a DELETE query

VERSION ^

version 0.40

SYNOPSIS ^

  my $sql = Fey::SQL->new_delete();

  # DELETE FROM Part
  #       WHERE Part.name LIKE '%Widget'
  $sql->delete();
  $sql->from($Part);
  $sql->where( $name, 'LIKE', '%Widget' );

  print $sql->sql($dbh);

DESCRIPTION ^

This class represents a DELETE query.

METHODS ^

This class provides the following methods:

Constructor

To construct an object of this class, call $query->delete() on a Fey::SQL object.

$delete->delete()

This method is basically a no-op that exists to so that Fey::SQL has something to call after it constructs an object in this class.

$delete->from(...)

This method specifies the FROM 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 deletes.

$delete->where(...)

See the Fey::SQL section on WHERE Clauses for more details.

$delete->order_by(...)

See the Fey::SQL section on ORDER BY Clauses for more details.

$delete->limit(...)

See the Fey::SQL section on LIMIT Clauses for more details.

$delete->sql()

Returns the full SQL statement which this object represents. A DBI handle must be passed so that identifiers can be properly quoted.

$delete->bind_params()

See the Fey::SQL section on Bind Parameters for more details.

$delete->delete_clause()

Returns the DELETE clause portion of the SQL statement as a string.

$delete->where_clause()

Returns the WHERE clause portion of the SQL statement as a string.

$delete->order_by_clause()

Returns the ORDER BY clause portion of the SQL statement as a string.

$delete->limit_clause()

Returns the LIMIT clause portion of the SQL statement as a string.

ROLES ^

BUGS ^

See Fey for details on how to report bugs.

AUTHOR ^

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2011 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
syntax highlighting: