NAME

Data::Phrasebook::SQL::Query - A query from a phrasebook.

SYNOPSIS

DESCRIPTION

CONSTRUCTOR

new

Don't use this directly. Let Data::Phrasebook::SQL create it for you.

METHODS

sql

Get/set the current sql statement, in a form suitable for passing straight to DBI.

sth

Get/set the current statement handle.

args

Return list of arguments that will be used as bind parameters to any placeholders. Any given arguments will replace the whole list.

Returns list in list context, arrayref in scalar.

order

As for args, but regarding the corresponding list of argument names.

The assorted order_XXX methods are supported as for args_XXX.

dbh

Get/set the database handle.

PREPARATION / EXECUTING METHODS

execute

Executes the query. Returns the result of DBI::execute.

Any arguments are given to order_args with the return of that method being used as arguments to DBI::execute. If no arguments, uses those already specified.

Calls prepare if necessary.

order_args

Given a hash or hashref of keyword to value mappings, organises an array of arguments suitable for use as bind parameters in the order needed by the query itself.

prepare

Prepares the query for execution. This method is called implicitly in most cases so you generally don't need to know about it.

rebind

Rebinds any bound values. Lets one pass a scalar reference in the arguments to order_args and have the bound value update if the original scalar changes.

This method is not needed externally to this class.

DELEGATED METHODS

Any method not mentioned above is given to the statement handle.

All these delegations will implicitly call prepare. Any fetch* methods will additionally call execute unless the statement handle is already active.

SEE ALSO

Data::Phrasebook, Data::Phrasebook::SQL.

AUTHOR

Original author: Iain Campbell Truskett (16.07.1979 - 29.12.2003).

Maintainer: Barbie <barbie@cpan.org>.

LICENCE AND COPYRIGHT

Copyright E<copy> Iain Truskett, 2003. All rights reserved.
Copyright E<copy> Barbie, 2004-2005. All rights reserved.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

The full text of the licences can be found in the F<Artistic> and
F<COPYING> files included with this module, or in L<perlartistic> and
L<perlgpl> in Perl 5.8.1 or later.