> From: Tomasi, Chuck [mailto:[EMAIL PROTECTED]]
> 
> I've got a web based app running on Sun Solaris 2.7, Oracle 
> 8.1.7.0, Perl
> 5.6.0, Apache.1.3.x, and of course, DBI (1.20), DBD (1.12)...
> 
> When Oracle runs in to an error, the error messages only go 
> to the Apache
> error_log.  Is there a way I can capture those and display them to the
> application in some pleasant format?

Easiest thing is to set RaiseError to true, set PrintError to false
(if you don't want them to go to the log), and do all DBI calls
in an eval block:

eval {
 my $dbh = DBI->connect(..., {RaiseError=>1,PrintError=>0});
 my $sth = $dbh->prepare(...);
 $sth->execute(...);
 while ($sth->fetch) {
  ...
 }
};
print "Got a an error: $@" if $@;

HTH,
Douglas Wilson

Reply via email to