
Untitled
By: a guest on
Aug 5th, 2012 | syntax:
None | size: 0.42 KB | hits: 9 | expires: Never
#!/usr/bin/env perl
use warnings;
use strict;
use DBI;
my $dbh = DBI->connect('dbi:Pg:dbname=regbox', '', '');
# Fails in DBD::Pg 2.19.1 if you use one placeholder more than once.
# Works if you remove one of the two placeholders.
my $sth = $dbh->prepare('
select 1 where 1 = :foo and 0 < :foo
');
$sth->bind_param(':foo', 1);
$sth->execute;
my $rows = $sth->rows;
print "ROWS [$rows]\n";
$sth->finish;
$dbh->disconnect;