Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: ROW_COUNT Question
Date: Sep 19 2002 9:22AM

On Wed, 2002-09-18 at 12:37, Stern, Meir wrote:
> I am trying to get the ROW_COUNT based on a ct_sql call which I exec a
> stored procedure that returns rows of data. for some reason when ever I try
> to print out the ROW_COUNT it comes up with a -1 instead of the amount of
> rows. My undarstanding is that ROW_COUNT gets set automatically with a
> ct_sql call.

I think you are hitting a bug, or maybe an unintended behavior.

ct_sql() does set the row count, but it only sets it at the end of the
command (I think), rather than when a query is done within the batch.
When you execute a stored procedure there are more than one result set,
and this means that the ROW_COUNT value will be set to the last result
set, which is normally the stored procedure's status result.

I'll have to look at the code to see if there is a way to make that work

Michael Peppler / / / ZetaTools, Inc /
ZetaTools: Call perl functions as Sybase stored procedures!