Sophie

Sophie

distrib > Mageia > 4 > i586 > media > core-release > by-pkgid > 7430c26be9f2100b767eafe32d3aefe7 > files > 24

perl-DBD-mysql-4.24.0-2.mga4.i586.rpm

#!/usr/bin/perl

use strict;
use warnings;
use Data::Dumper;

use DBI;

my $dsn = "DBI:Pg:database=postgres;host=localhost";
my $dbh = DBI->connect( $dsn, 'postgres', '', { RaiseError => 1 } )
or die $DBI::errstr;

$dbh->do('CREATE TABLE buggy ( id INT )');
$dbh->do('INSERT INTO buggy (id) VALUES (1)');
my $ref= $dbh->selectrow_arrayref(<<END, {}, 1);
SELECT id
FROM buggy
-- it's a bug!
WHERE id = ?
END
print Dumper $ref;
$dbh->do('DROP TABLE buggy');