Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: DIB:Pg returns select plan on execute

by chacham (Parson)
on Aug 17, 2012 at 15:44 UTC ( #988005=note: print w/replies, xml ) Need Help??


in reply to DIB:Pg returns select plan on execute

For example:

eval{$db = DBI->connect("DBI:ODBC:$config{db_odbc}", $config{db_user}, + $config{db_pass}, {PrintError=>0, RaiseError=>1, AutoCommit=>0})}; error("Could not connect to database:", map{" DBI: $_"} split /\n/, $D +BI::errstr) if $@;

In this example, error() is a custom function to print/log errors.