Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How can I do this gracefully? How do I set {RaiseError => 1} with my connect string above? I certainly don't want a string of errors and die happening. I've also unsuccessfully tried by checking the value of a parameter being set via || on the connect statement. I've also checked out: http://labs.redhat.com/cturner/DBI_AdvancedTalk_2002/$dbh = DBI->connect('dbi:Oracle:', qq{$bu_username/$bu_passwd@(DESCRIP +TION= (ADDRESS=(PROTOCOL=TCP)(HOST= $bu_host)(PORT=$bu_port)) (CONNECT_DATA=(SID=$bu_sid)))}, ""); if ( undef $dbh ) { print LF "Cannot connect to database!\n"; &log_send_mail; exit; } else { print "Connection to $bu_sid successful\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Graceful handling of DBI connect errors'
by blokhead (Monsignor) on Nov 15, 2002 at 15:40 UTC | |
|
Re: Graceful handling of DBI connect errors'
by Chief of Chaos (Friar) on Nov 15, 2002 at 12:33 UTC | |
by UnderMine (Friar) on Nov 15, 2002 at 13:07 UTC | |
|
Re: Graceful handling of DBI connect errors'
by ColtsFoot (Chaplain) on Nov 15, 2002 at 11:39 UTC | |
|
Re: Graceful handling of DBI connect errors'
by rob_au (Abbot) on Nov 15, 2002 at 22:12 UTC |