# connection to database my $dbh = DBI->connect("dbi:Oracle:CSCD001", "user", "password",{RaiseError=>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";