Sybase Stored Procedure issue

Sybase Stored Procedure issue

am 14.06.2006 18:27:09 von daglis

I am using DBI to connect to Sybase and run a stored procedure. The
perl script fails in the end with error:

DBD::Sybase::st fetchrow_array failed: Server message number=2737
severity=16 state=1 line=5 server=NJICELXSYBPRD2 text=Message passed to
PRINT must be of type CHAR or VARCHAR.
DBD::Sybase::st fetchrow_array failed: Server message number=2737
severity=16 state=1 line=5 server=NJICELXSYBPRD2 text=Message passed to
PRINT must be of type CHAR or VARCHAR.
ith error:


I noticed at the end after my procedure finishes, there is still some
data and it is 0. Why would this happen, I noticed that the stored
procedure returns a null after it completes.

Here is the code snippet:

my $sth = $dbh->prepare(qq[
declare \@name int
execute \@name = p_clearalldown \'$deskRegion\'
select \@name
print \@name
]);


if (! ($sth->execute() )) {
LogErrorAndDie ("Sybase Stored procedure p_clearalldown
failed".$dbh->errstr);
}
{
while(@data = $sth->fetchrow_array) {
## do something
print "data is @data\n";
print "$sth->{syb_result_type}\n";
}
redo if $sth->{syb_more_results};
}


if($sth->err())
{
LogErrorAndDie ("Sybase Stored procedure p_clearalldown failed
$dbh,$sth")
}




Here is the Ending part of the stored proc: THere are not OUTPUT
params.

delete ICE_AMX_PL_HIER



if ( @@rowcount < @delete_row_count )
begin
select "in ice_amx"
commit tran
select @leave_loop=1
break
end
commit tran
end
commit tran



Select "End Time: " + convert(varchar(35),getdate())