DBIx::NamedBinding - use named parameters instead of '?'


DBIx-NamedBinding documentation  | view source Contained in the DBIx-NamedBinding distribution.

Index


NAME

Top

DBIx::NamedBinding - use named parameters instead of '?'

VERSION

Top

Version 0.01

SYNOPSIS

Top

This module subclasses the DBI and allows you to use named query parameter placeholders instead of positional '?'.

    use DBI;

    my $dbh = DBI->connect($dsn, {
        RootClass => 'DBIx::NamedBinding',
    } );
    my $sth = $dbh->prepare('
        SELECT * FROM foo WHERE
            price        <     :price     AND
            sale_price   =     0          AND
            location     =     :location  AND
            inventory    >     :inventory AND
            sku          LIKE  :sku
    ');
    $sth->bind_param( price     => 14.95  );
    $sth->bind_param( location  => 'BMWH' );
    $sth->bind_param( inventory => 4      );
    $sth->bind_param( sku       => 'OH%'  );

    my $rv = $sth->execute();

Other than that, just use it like one would use the DBI.

AUTHOR

Top

Andrew Sweger, <yDNA at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-dbi-namedbinding at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBI-NamedBinding. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc DBIx::NamedBinding




You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBI-NamedBinding

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/DBI-NamedBinding

* CPAN Ratings

http://cpanratings.perl.org/d/DBI-NamedBinding

* Search CPAN

http://search.cpan.org/dist/DBI-NamedBinding

ACKNOWLEDGEMENTS

Top

My thanks to Colin Meyer for turning me on to the evils of subclassing the DBI.

COPYRIGHT & LICENSE

Top


DBIx-NamedBinding documentation  | view source Contained in the DBIx-NamedBinding distribution.