|
|
|
use DBI;
my $db_source = "dbi:Pg:dbname=????";
my $db_user = '????';
my $db_pswd = '????';
my $sql = "select monthnum, monthname from months order by monthnum";
my $dbh = DBI->connect($db_source, $db_user, $db_pswd);
my $sth = $dbh->prepare($sql);
$sth->execute();
while(my($num, $name) = $sth->fetchrow_array) {
printf("%2d %s\n", $num, $name);
}
$sth->finish();
$dbh->disconnect(); |
|
|
|
|