$s->execute; while($s->odbc_more_results) { # your error handler will catch prints }