in reply to Re^6: Capturing error thrown by a database
in thread Capturing error thrown by a database
sub OpenSybaseConnection { my ($srv, $user, $pwd, $db) = @_; my $dbh; $FH1=$_4; #???????????????????????????? eval { $dbh=DBI->connect( "dbi:Sybase:server=$srv", $user, $pwd, {RaiseError =>1, PrintError =>1} ) or die "Extra death $DBI::errstr"; $dbh->do("use $db"); }; if($@) # true if the eval failed (die'd at some point) { @proc_error=$@ ; print "inside if\n"; print "Hi:$@"; print "\nIn Common: @proc_error: HELP"; } else # this is the "no error" case { $common::conn_hdl = $dbh; print $FH1 "\n\nConnected to Server:$srv, Database:$db\n"; } return; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^8: Capturing error thrown by a database
by puneet.keswani (Novice) on Aug 01, 2011 at 18:30 UTC |