It calls a perl script which calls a stored procedure. The problem is that there are print statements in the stored proc and for some reason those print statements are making the perl proc think that $DB_ERROR is true. Like in this statement.
my $sybDw=new Sybase:
Blib $dw{'uid'},$dw{'pwd'},$dw{'server'},'ABC';
$sql="IQDBA.ABC_StoreProc";
$log->print("Executing the stored procedure, SMT_DealExtend");
$sybDw->nsql($sql, "HASH");
if ($DB_ERROR)
{ $log->print("ERROR while executing stored procedure: ABC_StoreProc");
$log->print($DB_ERROR);
$utilObj->emailError(message=>"EERROR in executing stored procedure: SMT_DealExtend: $DB_ERROR");
$log->print("....Exiting Program!!");
$log->close();
exit(1);
}
A solution that fixes this problem is removing the print statements. However, we want to be able to write the print statements in the stored proc to a log. Do you know of any way to get the stored proc print statement output from the perl proc and write that to a log?
my $sybDw=new Sybase:
$sql="IQDBA.ABC_StoreProc";
$log->print("Executing the stored procedure, SMT_DealExtend");
$sybDw->nsql($sql, "HASH");
if ($DB_ERROR)
{ $log->print("ERROR while executing stored procedure: ABC_StoreProc");
$log->print($DB_ERROR);
$utilObj->emailError(message=>"EERROR in executing stored procedure: SMT_DealExtend: $DB_ERROR");
$log->print("....Exiting Program!!");
$log->close();
exit(1);
}
A solution that fixes this problem is removing the print statements. However, we want to be able to write the print statements in the stored proc to a log. Do you know of any way to get the stored proc print statement output from the perl proc and write that to a log?