Sybase Stored Procedure issue



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())

.



Relevant Pages

  • Calling Sybase stored procedure from DTS Execute SQL Task
    ... Is it possible to call a Sybase stored procedure from DTS using the ... Execute SQL Task. ... I'll expect to pass input variables from global ...
    (microsoft.public.sqlserver.dts)
  • Execute Sybase Stored Procedure
    ... Does anyone know of an example of executing a Sybase stored procedure from ... I can use DTS to bring in data and process it. ...
    (microsoft.public.sqlserver.dts)
  • Transactions and cursors.
    ... I want to wrap a stored procedure in a BEGIN TRAN - COMMIT TRAN and abort if ... any update fails. ... The stored procedure uses a cursor and inserts or updates ... a single row in a single table for each iteration of the cursor. ...
    (microsoft.public.sqlserver.programming)
  • Re: Insert SQL does not work in stored procedure.
    ... I thought the "begin tran" and "commit tran" wraps the insert in an explicit ... >> On one of our development servers I've run into a problem with Insert ... The stored procedure works on other servers and used to work on ... >> BEGIN TRANSACTION ...
    (microsoft.public.sqlserver.programming)
  • How could I use a LookUp Query in a DataTransform Task to reach my goal?
    ... COMMIT TRAN ... I want to use the stored procedure to fill the PK column of this table ... I DO KNOW I could use an "Execute SQL Task" (the easiest and quickest ... Anybody could tell me how could I use a LookUp query in a "Data ...
    (microsoft.public.sqlserver.dts)