Zo has asked for the wisdom of the Perl Monks concerning the following question:
# connection to database my $dbh = DBI->connect("dbi:Oracle:CSCD001", "user", "password",{Raise +Error=>1,AutoCommit=>0}); # new code to catch DB return error $dbh->{RaiseError}=0; my $sth = $dbh->prepare("Select $fields From $table Where exe_c = 'N' +AND rownum < 151 "); $sth->execute(); # new code to catch DB return error print BATCH $dbh->errstr."\n"; @results{@fields} = (); $sth->bind_columns(map{\$results{$_} } @fields); # generates DBI log file DBI->trace( 2 , './dbi_trace.txt'); while($sth->fetch()) { # prints to screen to view process running print "$results{batch_line} <$results{rowid}>\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI Connect Error Trapping
by strider corinth (Friar) on Nov 08, 2002 at 17:52 UTC | |
|
Re: DBI Connect Error Trapping
by shemp (Deacon) on Nov 08, 2002 at 17:45 UTC | |
by hmerrill (Friar) on Nov 08, 2002 at 18:18 UTC | |
|
Re: DBI Connect Error Trapping
by CubicSpline (Friar) on Nov 08, 2002 at 18:25 UTC | |
|
Re: DBI Connect Error Trapping
by erasei (Pilgrim) on Nov 08, 2002 at 20:44 UTC |