use strict;
use warnings;
use DBI;
my $dbh=DBI->connect("dbi:Pg:database=DATABASE_NAME;host=HOSTNAME;port=5678", 'USERNAME', 'PASSWORD')
or die "Can't connect: ", $DBI::errstr;
$dbh->{RaiseError} = 1;
my $sql = q( select *
from <TABLENAME>
where <CONDITION>);
my @row = $dbh->selectrow_array($sql);
print join (",", @row) . "\n";
$dbh->disconnect();
use warnings;
use DBI;
my $dbh=DBI->connect("dbi:Pg:database=DATABASE_NAME;host=HOSTNAME;port=5678", 'USERNAME', 'PASSWORD')
or die "Can't connect: ", $DBI::errstr;
$dbh->{RaiseError} = 1;
my $sql = q( select *
from <TABLENAME>
where <CONDITION>);
my @row = $dbh->selectrow_array($sql);
print join (",", @row) . "\n";
$dbh->disconnect();
No comments :
Post a Comment