MSSQL::DBlib error messages



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 ${dbowner}..mytable");
$dbh->dbsqlexec;

while ($dbh->dbnextrow2($dataref, 1) != NO_MORE_ROWS) {
print $MY_OUTFILE "<!-- $$dataref{id} -->\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.

.



Relevant Pages

  • Is PERL --> MS SQL really that difficult?
    ... or is using perl on a linux server to extract information from an MS SQL server insanely difficult? ... I have seen other syntax for the connect statement for other databases such as MySQL and Oracle but never for MSSQL. ... I have searched dbi.perl.org as well for example syntax but all the examples I can find there are also for non-MS databases. ...
    (perl.dbi.users)
  • Portal Authentication
    ... Have a windows environement (IIS, MSSQL, PERL) and want users to ... authenticate before being able to enter the web site... ...
    (perl.beginners)
  • How do I connect MSSQL Server from linux perl
    ... In linux platform I am using perl and would like to connect MSSQL ... Server, which is installed on a windows server (connected through ...
    (perl.dbi.users)