MSSQL::DBlib error messages

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Hi. I'm pretty new to Perl and especially new to this particular MSSQL
module. I am curious how to retrieve detailed error messages in the
event a database error occurs. Here is a snippet of what I'm doing...

$dbh = MSSQL :: DBlib->dblogin($dbusr, $dbpw, $db);
$dbh->dbcmd("select top 1 id from $..mytable");

while ($dbh->dbnextrow2($dataref, 1) != NO_MORE_ROWS) {
print $MY_OUTFILE "<!-- $$dataref -->\n";

If an error occurs, such as the DB is being restore or something stupid
like the table doesn't exist, how could I print my error to my output
file (MY_OUTFILE)?

Thanks for the help in advance.

Site Timeline