my $dbh_b = DBI->connect(..., { RaiseError => 1 }); my $sth_b = $dbh_b->prepare($sql_b); $sth_b->execute();