Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing output of stored procedure to log file in perl

Status
Not open for further replies.

ecomajor

Programmer
Sep 13, 2004
7
US
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::DBlib $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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top