in reply to Graceful handling of DBI connect errors'
I hope this can help you.# ... # -------------------- # create db connection # -------------------- $dbase = DBI->connect("DBI:Oracle:$dbsid", $dbuser, $dbpassw, { Auto +Commit => 0 }); if (!(defined($dbase))){ # do error handling } # # ---------- # do the sql # ---------- # ... $dbase->{PrintError} = 0; $dbsth = $dbase->prepare( $sql ); $error = $dbase->errstr; if (defined ($error) && $error ne "") { # error handling # errormsg is stored in $error # ... $dbase->{set_err}=(0, ""); $dbase->{PrintError} = 1; # exit function or so # ... } else { # no error $dbase->{set_err}=(0, ""); $dbase->{PrintError} = 1; # ... } # ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Graceful handling of DBI connect errors'
by UnderMine (Friar) on Nov 15, 2002 at 13:07 UTC |