Capacio, Paula J wrote:

my $stmt = 'select count(*) from sysibm.badTblnm ';
my $sth = $dbh->prepare($stmt) or die "Prepare Failed\n";

DBD::DB2 doesn't seem to return false values for failures. Instead, try checking the sqlstate of the db handle:

my $sth = $dbh->prepare($stmt);
if ($dbh->state()) {
 die "Prepare Failed: " . $dbh->{errstr} . "\n";
}


->state() is available on db handles and statement handles, and contains the five-character sqlstate code.

Hope that helps.

-johnnnnnnnn

Reply via email to