I am trying to save a mssql runtime error in a variable and continue with all other data.
my $sth = $dbh->prepare("exec TEST_ABC_DB.dbo.testprocedure"); $sth->execute() ; my $db_error =$DBI::errstr;
I used the eval block, but it also does not work.
My procedure is as follows, (sample)
CREATE procedure testprocedure as select 'one' select 'three' select 10/0 select 'five'
When I run the script, it shows
Output signal
Row: one DBD::ODBC::st finish failed: [unixODBC][FreeTDS][SQL Server]Divide by zero error encountered. (SQL-22012) at testing.pl line 24. DBI::db=HASH(0xbe79a0)->disconnect invalidates 1 active statement handle (either destroy statement handles or call finish on them before disconnecting) at testing.pl line 28.
Do not show output even three . Displays only one.
source share