my @final_output; sub err_handler { my ($sqlstate, $msg, $nativeerr) = @_; # Strip out all of the driver ID stuff $msg =~ s/^(\[[\w\s:]*\])+//; push @final_output, $msg; return 0; } $dbh->{odbc_err_handler} = \&err_handler; my $sp_sth = $dbh->prepare('{call myproc}'); $sp_sth->execute; do { my $line; while (@sp_return_data = $sp_sth->fetchrow_array()) { $line = join (' | ', @sp_return_data) . ".\n"; push @final_output, $line; } } while ($sp_sth->{odbc_more_results});