DBIx::NamedBinding - use named parameters instead of '?'
Version 0.01
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.
Andrew Sweger, <yDNA at cpan.org>
<yDNA at cpan.org>
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.
bug-dbi-namedbinding at rt.cpan.org
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
My thanks to Colin Meyer for turning me on to the evils of subclassing the DBI.
Copyright 2008 Andrew Sweger, 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 DBIx::NamedBinding, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::NamedBinding
CPAN shell
perl -MCPAN -e shell install DBIx::NamedBinding
For more information on module installation, please visit the detailed CPAN module installation guide.