SQLMan has asked for the wisdom of the Perl Monks concerning the following question:
I have a script that seems to fail when it is scheduled. I am trying to put some error handling in. I would like to start with the connection to the database. This is my connection string.
What I would like to do is write the error message to a file that I have opened.my $dbh = DBI->connect( "dbi:ODBC:RETQC_SQL", "sa", "", {RaiseError => 1, PrintError => 1, AutoCommit => 0} ) or die "Unable to connect: $DBI::errstr\n";
open( OUTFILE, ">> $destination" ) or die "Couldn't open file for rea +ding.$!\n";
Edit by thelenm: fixed code tags
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How do I print errors
by davido (Cardinal) on Oct 01, 2003 at 17:00 UTC | |
Re: How do I print errors
by Gerard (Pilgrim) on Oct 01, 2003 at 17:07 UTC | |
Recommendation for Logging modules
by Molt (Chaplain) on Oct 02, 2003 at 10:34 UTC | |
Re: How do I print errors
by vek (Prior) on Oct 01, 2003 at 19:42 UTC | |
Re: How do I print errors
by tilly (Archbishop) on Oct 05, 2003 at 03:36 UTC | |
Re: How do I print errors
by sunadmn (Curate) on Oct 01, 2003 at 17:01 UTC |
Back to
Seekers of Perl Wisdom