TMTOWTDI and all that :-) - but please do correct me if this code is
inappropriate in some way:
#Assuming that the database handle $dbh is successfully defined.
my $sth = $dbh->prepare ('SELECT global_name FROM global_name') || die
"\n$0: Failed to prepare SQL statement: $dbh->errstr\n";
$sth->execute() || die "\n$0: Failed to execute SQL query: $sth->errstr\n";
my @data = $sth->fetchrow_array();
if ($sth->rows == 0) {
print "\nNo rows returned - Ok, so that didn't really work!.\n";
} else {
print "\nThe instance is @data\n";
}
Cheers,
Srikanth Madani